@jswork/next-redux-lite

1.0.0 • Public • Published

next-redux-lite

Lightweight version of the redux library.

version license size download

installation

npm install -S @jswork/next-redux-lite

apis

api args description
INIT_TYPE - @@redux/INIT_0.g5t24hclwrt
create reducers, initialState, enhancer Create store.
apply middleware1,middleware2... Apply middlewares.
getState - redux.getState
subscribe listener redux.subscribe
dispatch action redux.dispatch

usage

import NxReduxLite from '@jswork/next-redux-lite';

// create a redux store:
const store = NxReduxLite.create(reducers, {
  test: 123
});

// subscribe the store:
store.subscribe(()=>{
  console.log('get!')
});

// dispath:
store.dispatch({
  type:'INC',
  data: 1
});

// get latest state:
store.getState();

license

Code released under the MIT license.

Package Sidebar

Install

npm i @jswork/next-redux-lite

Weekly Downloads

8

Version

1.0.0

License

MIT

Unpacked Size

741 kB

Total Files

16

Last publish

Collaborators

  • afeiship