Created
January 29, 2019 10:54
-
-
Save rsxdalv/da7922cb0ebb64caf1bb66dd321dd634 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 * as R from "ramda"; | |
import { ActionTypes } from "../actions"; | |
import { ReducerFunction, ReducerIdenity } from "./i-root-state"; | |
export const toolReducer: Record<string, ReducerFunction> = { | |
[ActionTypes.SELECT_TOOL]: R.converge(R.assoc("tool"), [ | |
R.path(["action", "value"]), | |
ReducerIdenity, | |
]), | |
[ActionTypes.DESELECT_TOOL]: R.converge(R.assoc("tool"), [ | |
R.always(undefined), | |
ReducerIdenity, | |
]), | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment