0.0.2 • Published 7 years ago

redux-feline-actions v0.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

Redux feline actions

Easiest way to create Redux actions

Installation

npm install -s redux-feline-actions

Usage

import { createActions } from 'redux-feline-actions';

const actions = createActions({
  justSomeString: 'cats are cool', // will be called reducer JUST_SOME_STRING
  someFunction: v => 'payload with ' + v,
  someObject: {
    use: 'cat',
    method: 'eatFood',
    meta: 'blackCatMetaValue', // meta: {blackCatMetaValue: true}
    id: 'my_cat_number_one'
  },
  someObjectWithCustomPayload: {
    payload: 'two cats and five kittens'
    meta: {
      one: 1,
      two: 2
    }
  },
  someMoreComplexFunction: (a, b, meta) => ({
    payload: {
      cats: a,
      catFood: b
    },
    meta
  }),
  andIfINeedToCallSomeOtherReducer: {
    useReducer: 'customReducer', // will be called reducer CUSTOM_REDUCER
    payload: 'meow'
  }
})