concat(array)

create.concat create(actionType).concat Appropriate leaf state: array

Returns a Riduce-standard action to update the leaf's state by concatenating it with array.

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 an array

const concatToArr = actions.arr.create.concat
store.dispatch(concatToArr(['a', 'b', 'c']))
console.log(store.getState().arr) // [1, 2, 3, 'a', 'b', 'c']