concat(string)
create.concat
create(actionType).concat
Appropriate leaf state: string
Returns a Riduce-standard action to update the leaf's state by concatenating it with string
.
string
(string): the string to concatenateaction
(object): a Riduce-standard action
import { createStore } from 'redux'
import riduce from 'riduce'
const initialState = {
arr: [1, 2, 3],
str: 'foo'
}
const [reducer, actions] = riduce(initialState)
const store = createStore(reducer)
const concatToStr = actions.str.create.concat
store.dispatch(concatToStr('bar'))
console.log(store.getState().str) // 'foobar'