|
19 | 19 | </p>
|
20 | 20 |
|
21 | 21 | - Reactive redux store for `Dart` & `Flutter` inspired by **[RxRedux-freeletics](https://github.com/freeletics/RxRedux)**
|
| 22 | + |
22 | 23 | - A Redux store implementation entirely based on Dart `Stream`, with the power of `RxDart` (inspired by [redux-observable](https://redux-observable.js.org))
|
23 | 24 | that helps to isolate side effects. RxRedux is (kind of) a replacement for RxDart's `.scan()` operator.
|
24 | 25 |
|
@@ -46,6 +47,7 @@ This library offers a custom stream transformer `ReduxStoreStreamTransformer` (o
|
46 | 47 | - A Store is basically an stream container for state.
|
47 | 48 | This library offers a custom stream transformer `ReduxStoreStreamTransformer` (or extension method `reduxStore`) to create such a state container.
|
48 | 49 | It takes an `initialState` and a list of `SideEffect<State, Action>` and a `Reducer<State, Action>`.
|
| 50 | + |
49 | 51 | - Since version 2.x, add `RxReduxStore` class, built for Flutter UI.
|
50 | 52 |
|
51 | 53 | ### Action
|
@@ -205,7 +207,7 @@ State reducer(State state, Action action) {
|
205 | 207 |
|
206 | 208 | #### 5. Combine all it into one
|
207 | 209 |
|
208 |
| -- Using `ReduxStoreStreamTransformer`: |
| 210 | +- Using `ReduxStoreStreamTransformer`: |
209 | 211 |
|
210 | 212 | ```dart
|
211 | 213 | final Stream<Action> actions = PublishSubject<Action>();
|
@@ -251,7 +253,6 @@ The [following video](https://youtu.be/M7lx9Y9ANYo) (click on it) illustrates th
|
251 | 253 |
|
252 | 254 | [](https://youtu.be/M7lx9Y9ANYo)
|
253 | 255 |
|
254 |
| - |
255 | 256 | 0. Let's take a look at the following illustration:
|
256 | 257 | The blue box is the `View` (think UI).
|
257 | 258 | The `Presenter` or `ViewModel` has not been drawn for the sake of readability but you can think of having such additional layers between View and Redux State Machine.
|
@@ -353,12 +354,12 @@ upstreamActions.reduxStore(
|
353 | 354 | ```
|
354 | 355 |
|
355 | 356 | So the workflow is as follows:
|
356 |
| -1. Upstream emits `SomeAction` |
357 |
| -2. `reducer` processes `SomeAction` |
358 |
| -3. `SideEffect1` reacts on `SomeAction` and emits `OtherAction` as output |
359 |
| -4. `reducer` processes `OtherAction` |
360 |
| -5. `SideEffect2` reacts on `OtherAction` and emits `YetAnotherAction` |
361 |
| -6. `reducer` processes `YetAnotherAction` |
| 357 | +1. Upstream emits `SomeAction` |
| 358 | +2. `reducer` processes `SomeAction` |
| 359 | +3. `SideEffect1` reacts on `SomeAction` and emits `OtherAction` as output |
| 360 | +4. `reducer` processes `OtherAction` |
| 361 | +5. `SideEffect2` reacts on `OtherAction` and emits `YetAnotherAction` |
| 362 | +6. `reducer` processes `YetAnotherAction` |
362 | 363 |
|
363 | 364 | ### Can I use `variable` and `function` for `SideEffects` or `Reducer`?
|
364 | 365 |
|
|
0 commit comments