Created
February 25, 2018 15:40
-
-
Save binaryta/21c8ffe9079deb1b6de5778c959a0d72 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 { ActionsType, ActionResult } from "hyperapp" | |
import { State } from "./state" | |
export interface Actions { | |
down: (value: number) => (state: State) => ActionResult<State>; | |
up: (value: number) => (state: State) => ActionResult<State>; | |
} | |
export const actions: ActionsType<State, Actions> = { | |
down: (value: number) => (state) => { | |
return { count: state.count - value } | |
}, | |
up: (value: number) => (state) => { | |
return { count: state.count + value } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment