reactive-rx-redux-js
Rx-based Redux implementation, inspired by https://github.com/Holmusk/HMReactiveRedux-iOS.git.
Rx store
The first implementation of the store is the RxStore, which can be accessed with:
ReduxStore.Rx.create...reducers: Observable<RxReducer<any>>;
In order to use this store, we define BehaviorSubject instances as action creators, as follows:
;;;
Then map these BehaviorSubject objects to emit RxReducer whose type signature is as follows:
;
Which is a function to be called when new value arrives for a stream. A sample setup is as follows:
; ; ;; ;; wrapper.numberAtNode'a.b.c'.pipedoOnNextconsole.log.subscribe; action1.next1;action2.next2;action3.next3;
Every time the Subject pushes a value, it will be pushed onto the state stream and used to compute the next state.
Dispatch store
The second implementation is the same as normal Redux store, whereby the store is responsible for dispatching actions.