Created
March 6, 2016 06:36
-
-
Save oakfang/549a51451d2362466ec8 to your computer and use it in GitHub Desktop.
Exrtact s State Stream from a redux store
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { BehaviourSubject } from 'rx'; | |
| export function getStateStream(store) { | |
| const sub = new BehaviourSubject(store.getState()); | |
| store.subscribe(state => sub.toNext(sub)); | |
| return sub.asObservable(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
new redux