You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -181,6 +166,8 @@ actor FeatureViewStore: ScreenActionStore {
181
166
}
182
167
```
183
168
169
+
> **How it works:** You only write business logic in `receive(action:)` and `throw` on errors. The framework's `dispatch` method (called by `nonisolatedReceive`) automatically handles `loadingStarted`, `loadingFinished`, and error routing to `viewState?.showError()`. No boilerplate needed.
170
+
184
171
**Action Flow:** Here's how actions are processed through `ActionLocker` and `LoadingTrackable`:
let producer = StreamProducer<Int>(withLatest: false)
662
649
```
663
650
664
-
**Non-isolated methods** for use from `nonisolated`or `deinit`contexts:
651
+
**Non-isolated methods** for use from `nonisolated` contexts:
665
652
-`nonIsolatedEmit(_ element:)` - Emits from a non-isolated context
666
-
-`nonIsolatedFinish()` - Finishes the stream from a non-isolated context
653
+
-`nonIsolatedFinish()` - *(Deprecated)* Streams are automatically finished when the producer is deallocated
667
654
668
655
### CancelBag
669
656
670
-
Manages and cancels multiple async tasks. Essential for cleanup in actors and view models.
657
+
Manages and cancels multiple async tasks. Completed tasks are automatically removed from the bag. All remaining tasks are cancelled when the bag is deallocated.
|`ScreenActionStore`| Actor-based protocol for ViewModels. Requires `binding(state:)` and `receive(action:)`|
725
+
|`ScreenActionStore`| Actor-based protocol for ViewModels. Requires `receive(action:) async throws` and `viewState`. Provides `nonisolatedReceive` and centralized `dispatch` for loading/error handling|
731
726
|`ActionLockable`| Provides a `lockKey` for action deduplication. Auto-conforms for `Hashable` types |
727
+
|`NonPresentableError`| Protocol for errors that should be logged but not shown to the user (`isSilent: Bool`) |
732
728
|`LoadingTrackable`| Declares whether an action should track loading state via `canTrackLoading`|
733
729
|`StateUpdatable`| Provides `updateState(_:withAnimation:disablesAnimations:)` for batched state updates |
734
730
|`PlaceholderRepresentable`| Declares `placeholder` and `isPlaceholder` for skeleton loading |
0 commit comments