Skip to content

Rename runtime event observers - #51

Merged
ollieatkinson merged 1 commit into
trunkfrom
oliver--event-observers
Jun 4, 2026
Merged

Rename runtime event observers#51
ollieatkinson merged 1 commit into
trunkfrom
oliver--event-observers

Conversation

@ollieatkinson

Copy link
Copy Markdown
Owner

Renames runtime event observation APIs away from subscription terminology and updates the SwiftUI event modifier lifecycle.

@ollieatkinson
ollieatkinson marked this pull request as ready for review June 4, 2026 07:35
@ollieatkinson
ollieatkinson requested a review from Copilot June 4, 2026 07:35

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread Sources/SwiftLexicon/SwiftUI.swift Outdated
Comment thread Sources/SwiftLexicon/SwiftUI.swift Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.thenEvents.handler, and subscribe(...)on(...), introducing Events.Observer / EventObserver.
  • Updates SwiftUI View APIs from onEvent / onEvents to on(...) 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 thenhandler; 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.

Comment thread Sources/SwiftLexicon/SwiftUI.swift Outdated
@ollieatkinson
ollieatkinson force-pushed the oliver--event-observers branch from 52091ac to bcd9d60 Compare June 4, 2026 08:33
@ollieatkinson
ollieatkinson merged commit b330dae into trunk Jun 4, 2026
2 checks passed
@ollieatkinson
ollieatkinson deleted the oliver--event-observers branch June 4, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants