Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created November 2, 2017 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/e59fa1ab63d2ab106cdf60cb5281b455 to your computer and use it in GitHub Desktop.
Save matthieu-D/e59fa1ab63d2ab106cdf60cb5281b455 to your computer and use it in GitHub Desktop.
componentWillLoad() {
this.getStoreService();
const preloadedState = [ {id:1, value:'Hello'} ];
this.store = createStore<any>(this.todoReducer, preloadedState);
this.todos = this.store.getState();
this.store.subscribe(() =>{
this.todos = this.store.getState();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment