Created
August 2, 2018 20:09
-
-
Save dpalita/8c93ebff9ded0ad566c79862b836d7d3 to your computer and use it in GitHub Desktop.
Use the AppInitAction and the previously stored initial state to bootstrap the app
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
@Injectable() | |
export class AccountReducer extends EntityReducer<Account> { | |
private initialState: AccountState | |
createReducer() { | |
return (state: AccountState, action: Action) => { | |
if (action instanceof AppInitAction && state === undefined) { | |
return initialState | |
} else { | |
... | |
} | |
} | |
} | |
bootstrap(): Promise<void> { | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment