Created
July 30, 2016 15:12
-
-
Save JeremyLikness/f3d00edcabced5182dacec7cedc57fb1 to your computer and use it in GitHub Desktop.
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
| export class ReduxAdventureAppComponent { | |
| private _store: Store<Dungeon>; | |
| public dungeon: Dungeon; | |
| constructor() { | |
| this._store = createStore(mainReducer); | |
| this.dungeon = this._store.getState(); | |
| this._store.subscribe(() => this.dungeon = this._store.getState()); | |
| } | |
| title = 'Welcome to the Redux Adventure!'; | |
| public handleAction(action: string): void { | |
| this._store.dispatch(createAction(this._store.getState(), action)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment