Skip to content

Instantly share code, notes, and snippets.

@krainboltgreene
Created March 26, 2018 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krainboltgreene/17d466d0cc4d00582b8f661c96ed3ebb to your computer and use it in GitHub Desktop.
Save krainboltgreene/17d466d0cc4d00582b8f661c96ed3ebb to your computer and use it in GitHub Desktop.
export {default as updateInput} from "./updateInput"
export {default as submitAccount} from "./submitAccount"
import {createStore} from "redux"
import reducers from "./reducers"
export default createStore(
(state, action) => reactions[action.type](state, action),
{}
)
export default function submitAccount (state, action) {
return state
}
import mergeLeftDeep from "@unction/mergeleftdeep"
export default function updateInput (state, action) {
return mergeLeftDeep(
state,
{
forms: {
[action.payload.form]: {
fields: {
[action.payload.field]: action.payload.value
}
}
}
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment