refactor: Polish effect API and documentation#14
Merged
Merged
Conversation
This PR tightens the public API and documentation around EffectView’s effect runtime. The main API-level change is that `TransducerEffect` is now a public struct backed by an internal effect representation, so callers use the documented helper functions (`run`, `task`, `request`, `cancel`, `sequence`, etc.) instead of depending on underscored enum cases. It also updates terminology around event dispatching, replacing stale `enqueue` / `perform` references with the current `post` / `send` / `request` model, and clarifies when `try?` is appropriate versus when dispatch failures should be propagated as runtime failures. - Hide effect implementation details behind `TransducerEffect` - Rename runtime boundary error type to `RuntimeError` - Comment out unfinished low-level `Transducer.run` API - Route initial event failures through runtime control instead of printing - Clarify `post`, `send`, and `request` semantics in docs - Update examples to use public effect helper APIs - Add README framing for `Transducer` as reducer-like but effect-emitting - Expand docs around dispatch failure and `try?` usage - Fix typos and stale terminology across docs, tests, and examples - `swift test` - Passes: 58 tests in 8 suites Known existing warnings remain for deprecated SwiftUI `onChange(of:perform:)` usage in tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR tightens the public API and documentation around EffectView’s effect runtime.
The main API-level change is that
TransducerEffectis now a public struct backed by an internal effect representation, so callers use the documented helper functions (run,task,request,cancel,sequence, etc.) instead of depending on underscored enum cases.It also updates terminology around event dispatching, replacing stale
enqueue/performreferences with the currentpost/send/requestmodel, and clarifies whentry?is appropriate versus when dispatch failures should be propagated as runtime failures.Hide effect implementation details behind
TransducerEffectRename runtime boundary error type to
RuntimeErrorComment out unfinished low-level
Transducer.runAPIRoute initial event failures through runtime control instead of printing
Clarify
post,send, andrequestsemantics in docsUpdate examples to use public effect helper APIs
Add README framing for
Transduceras reducer-like but effect-emittingExpand docs around dispatch failure and
try?usageFix typos and stale terminology across docs, tests, and examples
swift testPasses: 58 tests in 8 suites
Known existing warnings remain for deprecated SwiftUI
onChange(of:perform:)usage in tests.