Last active
January 16, 2018 22:12
-
-
Save kobvel/5c583185e23826cd3603d511ef2dfee2 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
initProfileData(): void { | |
this.store.take(1).subscribe(store => { | |
if (!store.profile.profileData) { | |
this.apiService.getProfileData().toPromise() | |
.then(data => { | |
this.store.dispatch(new profileActions.UpdateAction(data)); | |
}) | |
.catch(err => { | |
this.router.navigate(['/404']) | |
}); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment