Example Application
In this chapter, you'll be creating a simple counter application using @ngrx. Your app will allow users to increment and decrement a number by one, as well as reset that value back to zero. Here's the AppState
that we'll be using throughout the example:
app/models/appState.ts
import {Counter} from './counter';
export interface AppState {
readonly counter: Counter;
}
app/models/counter.ts
export interface Counter {
readonly currentValue: number;
}
It's good practice to declare each interface in its own file, and create alogical directory structure if you have seven or more interfaces used by yourapplication.
原文: https://angular-2-training-book.rangle.io/handout/state-management/ngrx/example_application.html