Skip to content

feat: Refactor Effect Factories - #21

Merged
couchdeveloper merged 1 commit into
mainfrom
refactorEffectFactoriesIntoEffect
Jun 6, 2026
Merged

feat: Refactor Effect Factories#21
couchdeveloper merged 1 commit into
mainfrom
refactorEffectFactoriesIntoEffect

Conversation

@couchdeveloper

Copy link
Copy Markdown
Owner

Summary
• Switch docs and examples to dot-prefixed factories: .task, .cancel, .sequence, .action, .send, .observe. • Update SwiftUI snippets to wrap modifiers on a view (e.g., ContentView().refreshable { ... }). • Move observe helpers to TransducerEffect namespace and pass env to handlers.

Documentation changes
• ArchitecturalComparison, CorrectByConstruction, Recipes, TamingAsyncTasksInSwiftUIViews, UsingEnvForDependencyInjection, SwiftUIFirst:
• run → .task; cancel/sequence → .cancel/.sequence; fix signatures to -> Effect?.
• Replace post with input(...); add concise Button/onChange shortcut.
• Wrap .refreshable/.task(id:) in ContentView().

Examples/tests changes
• Examples (Counter, Movies, RemoteCounter): use .task/.cancel/.sequence and .observe; minor stylistic consistency. • Tests (EffectViewTests, EffectViewInputTests, EffectObservableTests, EffectActorTests, TaskSubscriptionTests, AsyncActionRuntimeTests):
• Replace task(...) with .task(...), sequence([...]) with .sequence([...]), cancel with .cancel.
• Use .action and .send where appropriate; update observe to .observe with (input, value, env).

Summary
• Switch docs and examples to dot-prefixed factories: .task, .cancel, .sequence, .action, .send, .observe.
• Update SwiftUI snippets to wrap modifiers on a view (e.g., ContentView().refreshable { ... }).
• Move observe helpers to TransducerEffect namespace and pass env to handlers.

Documentation changes
• ArchitecturalComparison, CorrectByConstruction, Recipes, TamingAsyncTasksInSwiftUIViews, UsingEnvForDependencyInjection, SwiftUIFirst:
   • run → .task; cancel/sequence → .cancel/.sequence; fix signatures to -> Effect?.
   • Replace post with input(...); add concise Button/onChange shortcut.
   • Wrap .refreshable/.task(id:) in ContentView().

Examples/tests changes
• Examples (Counter, Movies, RemoteCounter): use .task/.cancel/.sequence and .observe; minor stylistic consistency.
• Tests (EffectViewTests, EffectViewInputTests, EffectObservableTests, EffectActorTests, TaskSubscriptionTests, AsyncActionRuntimeTests):
   • Replace task(...) with .task(...), sequence([...]) with .sequence([...]), cancel with .cancel.
   • Use .action and .send where appropriate; update observe to .observe with (input, value, env).
@couchdeveloper
couchdeveloper merged commit 87ca909 into main Jun 6, 2026
1 check passed
@couchdeveloper
couchdeveloper deleted the refactorEffectFactoriesIntoEffect branch June 6, 2026 11:22
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.

1 participant