Skip to content

Commit

Permalink
Updated migration docs (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazaiMazai authored Sep 3, 2024
1 parent aec5aa3 commit d992664
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Docs/Migration-Guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,41 @@ Here is an overview of what to be changed:
+ )
```

### Action Interceptor Changes

Now there is no need in Action Interceptor any more, built-in `AsyncActions` protocol should be used instead:


```diff

- protocol AsyncAppAction: Action {
- func execute(completeHandler: @escaping (AppAction) -> Void)
- }
+ protocol AsyncAppAction: AsyncAction & AppAction {}

- let storeFactory = StoreFactory<AppState, Action>(
- initialState: initialState,
- interceptor: { action, dispatch in
- guard let action = (action as? AsyncAppAction) else {
- return
- }
-
- DispatchQueue.main.async {
- action.execute(completeHandler: dispatch)
- }
- },
- reducer: reducer
-)

+ let store = StateStore(
+ MyInitialState(),
+ qos: .userInteractive,
+ reducer: myReducer
+ )
```



### Child Store Changes

```diff
Expand Down

0 comments on commit d992664

Please sign in to comment.