Last active
February 15, 2019 21:35
-
-
Save splincode/235e668275de55342ae188744aa2d138 to your computer and use it in GitHub Desktop.
This file contains 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 { Dispatch } from '@ngxs-labs/dispatch-decorator'; | |
import { CounterState, Increment } from './counter.state'; | |
... | |
@Component({ | |
selector: 'my-app', | |
template: ` | |
<h1>Count is {{ counter$ | async }}<h1> | |
<button (click)="increment()">increment</button> | |
` | |
}) | |
export class AppComponent { | |
@Select(CounterState) public counter$: Observable<number>; | |
@Dispatch() public increment = () => new Increment(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment