Created
April 10, 2019 17:26
-
-
Save splincode/a6f421f1947efdf621fcf8f5ebdcfd83 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
@State<number[]>({ | |
name: 'todos', | |
defaults: [1, 2, 3] | |
}) | |
export class AppState { | |
@Selector() public static mutableTodos(state: number[]): number[] { | |
return state.reverse(); | |
} | |
@Selector() public static immutableTodos(state: number[]): number[] { | |
return [...state].reverse(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment