Skip to content

nerjs/create-redux-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-redux-store

Util for create redux store


installation:

npm install create-redux-store

quick start:

import:

es5:

var createReduxStore = require('create-redux-store');

es6:

import createReduxStore from 'create-redux-store';

examples:

creating

const store = createReduxStore(reduser,middleware);
reduser - Function or Object 
middleware - Function or the array of functions

how it works

store.dispatch('test:action');
// set { type : 'test:action'}

store.dispatch(new Promise());
// promise.then(result => store.dispatch(result)
// promise.catch(error => store.dispatch({ type: '@@ERROR', error: error})

store.dispatch(new Error());
//set { type : '@@ERROR', error : Error }

store.dispatch([
  {
    type : 'test:action:1',
    payload : 'test:payload'
  },
  {
    type : 'test:action:2'
  },
    'test:action:3'
  ]);

When the array is passed, subscribers will be called once after the last action is processed.

Processing of actions for q and m remains the same.

If NODE_ENV=development, redux-devtools-extension is automatically connected


more tests

https://github.com/kkarifan/create-redux-store/tree/master/tests

OR:

npm run test:redusers

npm run test:string

npm run test:error

npm run test:promise

npm run test:array

npm run test:mixedarray

npm run test:perf

npm run test:mdw

npm run test:objectmdw


About

Util for create redux store

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published