Rename runtime event observers - #51
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 52091acee1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
This PR renames the runtime event observation API surface from “subscription” terminology to “observer” terminology, and updates the SwiftUI View event modifier implementation to use the new observation model.
Changes:
- Renames
Events.then→Events.handler, andsubscribe(...)→on(...), introducingEvents.Observer/EventObserver. - Updates SwiftUI
ViewAPIs fromonEvent/onEventstoon(...)overloads and rewrites the modifier lifecycle to be task-based. - Updates and renames tests and builder utilities to match the new “observer” naming and behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Tests/SwiftLexiconTests/SwiftUISupportTests.swift | Updates SwiftUI modifier usage from onEvent(s) to new on(...) overloads. |
| Tests/SwiftLexiconTests/SwiftLexicon™.swift | Renames handler construction from then to handler. |
| Tests/SwiftLexiconTests/EventSubscriptionSetBuilderTests.swift | Removes old subscription builder tests (superseded by observer naming). |
| Tests/SwiftLexiconTests/EventObserverTests.swift | Renames/expands tests to cover the new on(...) observer API and semantics. |
| Tests/SwiftLexiconTests/EventObserverSetBuilderTests.swift | Adds tests for the renamed observer set result builder. |
| Sources/SwiftLexicon/SwiftUI.swift | Replaces onEvent(s) APIs with on(...) and rewrites the SwiftUI modifier to use task-driven observation. |
| Sources/SwiftLexicon/Events.swift | Introduces Events.Observer and new on(...) APIs; renames then → handler; updates operators to return observers. |
| Sources/SwiftLexicon/EventObserverSetBuilder.swift | Renames the result builder/types from subscription-oriented to observer-oriented. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
52091ac to
bcd9d60
Compare
Renames runtime event observation APIs away from subscription terminology and updates the SwiftUI event modifier lifecycle.