Skip to content

Instantly share code, notes, and snippets.

@splincode
Created April 10, 2019 17:25
Show Gist options
  • Save splincode/d57ddad57d8868f8abf0b38fa2835eaf to your computer and use it in GitHub Desktop.
Save splincode/d57ddad57d8868f8abf0b38fa2835eaf to your computer and use it in GitHub Desktop.
@Component({
selector: 'my-app',
template: `
<b>default</b>: {{ todos$ | async | json }} <br>
<b>mutable reverse</b>: {{ mutableTodos$ | async | json }} <br>
<b>immutable reverse</b>: {{ immutableTodos$ | async | json }} <br>
`
})
export class AppComponent {
@Select(AppState)
public todos$: Observable<number[]>;
@Select(AppState.mutableTodos)
public mutableTodos$: Observable<number[]>;
@Select(AppState.immutableTodos)
public immutableTodos$: Observable<number[]>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment