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
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -318,7 +318,7 @@ inputActions.reduxStore(
318
318
The problem is that from upstream we get `Int 1`.
319
319
But since `SideEffect` reacts on that action `Int 1` too, it computes `1 * 2` and emits `2`, which then again gets handled by the same SideEffect ` 2 * 2 = 4` and emits `4`, which then again gets handled by the same SideEffect `4 * 2 = 8` and emits `8`, which then getst handled by the same SideEffect and so on (endless loop) ...
320
320
321
-
### Who processes an `Action` first: `Reducer` or `SideEffect`?
321
+
### Who processes an `Action` first: `Reducer` or `SideEffect`
322
322
323
323
Since every Action runs through both `Reducer` and registered `SideEffects` this is a valid question.
324
324
Technically speaking `Reducer` gets every `Action` from upstream before the registered `SideEffects`.
@@ -361,7 +361,7 @@ So the workflow is as follows:
361
361
5. `SideEffect2` reacts on `OtherAction` and emits `YetAnotherAction`
362
362
6. `reducer` processes `YetAnotherAction`
363
363
364
-
### Can I use `variable` and `function` for `SideEffects` or `Reducer`?
364
+
### Can I use `variable` and `function` for `SideEffects` or `Reducer`
365
365
366
366
Absolutely. `SideEffect` is just a type alias for a function `typedef Stream<A> SideEffect<S, A>(Stream<A> actions, GetState<S> state);`.
367
367
@@ -410,7 +410,7 @@ State reducer(State state, Action action) {
410
410
}
411
411
```
412
412
413
-
### Is `distinct` (More commonly known as `distinctUntilChanged` in other Rx implementations) considered as best practice?
413
+
### Is `distinct` (More commonly known as `distinctUntilChanged` in other Rx implementations) considered as best practice
414
414
Yes it is because `reduxStore(...)` is not taking care of only emitting state that has been changed
415
415
compared to previous state.
416
416
Therefore, `.distinct()` is considered as best practice.
@@ -421,7 +421,7 @@ actions
421
421
.listen(view.render);
422
422
```
423
423
424
-
### What if I would like to have a SideEffect that returns no Action?
424
+
### What if I would like to have a SideEffect that returns no Action
425
425
426
426
For example, let's say you just store something in a database, but you don't need a Action as result
427
427
piped backed to your redux store. In that case you can simple use `Stream.empty()` like this:
.takeUntil(actions.whereType<Action2>()); // Once Action2 triggers the whole SideEffect gets canceled.
450
450
```
451
451
452
-
### Do I need an Action to start observing data?
452
+
### Do I need an Action to start observing data
453
453
Let's say you would like to start observing a database right from the start inside your Store.
454
454
This sounds pretty much like as soon as you have subscribers to your Store and therefore you don't need a dedicated Action to start observing the database.
0 commit comments