Created
May 6, 2020 16:37
-
-
Save adamgen/8936c8eb8628ae56c8ba41ffe60f298d to your computer and use it in GitHub Desktop.
NGRX | Use effects and router-store to isolate route related side π§πΌββοΈ effects - good component
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
import { Store, select } from β@ngrx/storeβ; | |
import { Component } from β@angular/coreβ; | |
@Component({ | |
selector: βapp-rootβ, | |
template: `{{selectedId$ | async | json}}`, | |
}) | |
export class HomeComponent { | |
selectedId$ = this.store.pipe(select((state: any) => state.featureName.selectedId)); | |
constructor( | |
private store: Store, | |
) { } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment