Skip to content

parakhod/redux-feline-actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'
  }
})

About

Easiest way to create Redux actions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published