Last active
January 2, 2019 14:12
-
-
Save splincode/a8bcc0f1cf2dc17b60c3a5a9ba62e54a 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
@State<string[]>({ | |
name: 'animals', | |
defaults: [] | |
}) | |
export class AnimalsState { | |
@Receiver() | |
public static addAnimal(ctx: StateContext<string[]>, action: EmitterAction<string>) { | |
ctx.setState((state) => [ ...state, action.payload ]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment