Skip to content

Commit bf2b9b5

Browse files
William Berntingtimdorr
authored andcommitted
give redux-subscriber some attention in StoreSetup.md (#2433)
It has both technical scalability and a good level of documentation. It took me a while to find it, so I hope this can change things for future readers.
1 parent 8b3e0cb commit bf2b9b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/faq/StoreSetup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ This chain of middleware is defined by the arguments passed to the `applyMiddlew
6262

6363
Redux provides a single `store.subscribe` method for notifying listeners that the store has updated. Listener callbacks do not receive the current state as an argument—it is simply an indication that *something* has changed. The subscriber logic can then call `getState()` to get the current state value.
6464

65-
This API is intended as a low-level primitive with no dependencies or complications, and can be used to build higher-level subscription logic. UI bindings such as React Redux can create a subscription for each connected component. It is also possible to write functions that can intelligently compare the old state vs the new state, and execute additional logic if certain pieces have changed. Examples include [redux-watch](https://github.com/jprichardson/redux-watch) and [redux-subscribe](https://github.com/ashaffer/redux-subscribe) which offer different approaches to specifying subscriptions and handling changes.
65+
This API is intended as a low-level primitive with no dependencies or complications, and can be used to build higher-level subscription logic. UI bindings such as React Redux can create a subscription for each connected component. It is also possible to write functions that can intelligently compare the old state vs the new state, and execute additional logic if certain pieces have changed. Examples include [redux-watch](https://github.com/jprichardson/redux-watch), [redux-subscribe](https://github.com/ashaffer/redux-subscribe) and [redux-subscriber](https://github.com/ivantsov/redux-subscriber) which offer different approaches to specifying subscriptions and handling changes.
6666

6767
The new state is not passed to the listeners in order to simplify implementing store enhancers such as the Redux DevTools. In addition, subscribers are intended to react to the state value itself, not the action. Middleware can be used if the action is important and needs to be handled specifically.
6868

@@ -80,4 +80,4 @@ The new state is not passed to the listeners in order to simplify implementing s
8080
- [#1300: Redux is great but major feature is missing](https://github.com/reactjs/redux/issues/1300)
8181

8282
**Libraries**
83-
- [Redux Addons Catalog: Store Change Subscriptions](https://github.com/markerikson/redux-ecosystem-links/blob/master/store.md#store-change-subscriptions)
83+
- [Redux Addons Catalog: Store Change Subscriptions](https://github.com/markerikson/redux-ecosystem-links/blob/master/store.md#store-change-subscriptions)

0 commit comments

Comments
 (0)