Skip to content

Commit c27453c

Browse files
committed
fix md
1 parent 00859eb commit c27453c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ inputActions.reduxStore(
318318
The problem is that from upstream we get `Int 1`.
319319
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) ...
320320

321-
### Who processes an `Action` first: `Reducer` or `SideEffect`?
321+
### Who processes an `Action` first: `Reducer` or `SideEffect`
322322

323323
Since every Action runs through both `Reducer` and registered `SideEffects` this is a valid question.
324324
Technically speaking `Reducer` gets every `Action` from upstream before the registered `SideEffects`.
@@ -361,7 +361,7 @@ So the workflow is as follows:
361361
5. `SideEffect2` reacts on `OtherAction` and emits `YetAnotherAction`
362362
6. `reducer` processes `YetAnotherAction`
363363

364-
### Can I use `variable` and `function` for `SideEffects` or `Reducer`?
364+
### Can I use `variable` and `function` for `SideEffects` or `Reducer`
365365

366366
Absolutely. `SideEffect` is just a type alias for a function `typedef Stream<A> SideEffect<S, A>(Stream<A> actions, GetState<S> state);`.
367367

@@ -410,7 +410,7 @@ State reducer(State state, Action action) {
410410
}
411411
```
412412

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
414414
Yes it is because `reduxStore(...)` is not taking care of only emitting state that has been changed
415415
compared to previous state.
416416
Therefore, `.distinct()` is considered as best practice.
@@ -421,7 +421,7 @@ actions
421421
.listen(view.render);
422422
```
423423

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
425425

426426
For example, let's say you just store something in a database, but you don't need a Action as result
427427
piped backed to your redux store. In that case you can simple use `Stream.empty()` like this:
@@ -435,7 +435,7 @@ Stream<Action> saveToDatabaseSideEffect(Stream<Action> actions, GetState<State>
435435
}
436436
```
437437

438-
### How do I cancel ongoing `SideEffects` if a certain `Action` happens?
438+
### How do I cancel ongoing `SideEffects` if a certain `Action` happens
439439

440440
Let's assume you have a simple `SideEffect` that is triggered by `Action1`.
441441
Whenever `Action2` is emitted our `SideEffect` should stop.
@@ -449,7 +449,7 @@ mySideEffect(Stream<Action> actions, GetState<State> getState) =>
449449
.takeUntil(actions.whereType<Action2>()); // Once Action2 triggers the whole SideEffect gets canceled.
450450
```
451451

452-
### Do I need an Action to start observing data?
452+
### Do I need an Action to start observing data
453453
Let's say you would like to start observing a database right from the start inside your Store.
454454
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.
455455

0 commit comments

Comments
 (0)