Last active
August 2, 2018 20:17
-
-
Save dpalita/4e814ac43f1b915d9e03e14dc7dddc62 to your computer and use it in GitHub Desktop.
Trigger an action at app init
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
@NgModule({ | |
... | |
}) | |
export class AppModule { | |
constructor(applicationInitStatus: ApplicationInitStatus, | |
store: Store<AppState>) { | |
// dispatch the app init action when all stores have add a chance to rehydrate from indexedDb | |
applicationInitStatus.donePromise.then(() => store.dispatch(new AppInitAction())) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment