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.

Parameters

Returns

action (object): a Riduce-standard action

Example

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)

Concatenating a string

const concatToStr = actions.str.create.concat
store.dispatch(concatToStr('bar'))
console.log(store.getState().str) // 'foobar'