1.0.1 • Published 5 years ago

react-redux-thunk-store v1.0.1

Weekly downloads
16
License
MIT
Repository
github
Last release
5 years ago

React Redux Thunk Store

CircleCI codecov npm bundle size (minified) npm (scoped) npm Open Source Helpers PeerDependencies Dependencies DevDependencies

To simplyfi the redux store creattion and management. I developed this library to help to create and manage the store easier and simpler.

It fully compatible with redux tool for Chrome to monitor the state in DEVELOPMENT mode.

Installation

mpn install --save-dev  redux-devtools-extension redux-immutable-state-invariant
npm install --save-dev react-redux-thunk-store

Sample:

import React from "react";
import Provider from "react-redux-thunk-store";
import ReactDOM from "ReactDOM";

const reducer = (store = [], action) => {
  //This is sample reducer
  if (action.type === "LOADDED") return [{ id: 1 }];
  return store;
};

const rootRecuders ={
  values:reducer,
  others:otherReducer,
  ...
}

ReactDOM.render(
  <Provider reducers={rootRecuders}>
    <div>Hello Store</div>
  </Provider>,
  document.getElementById("root")
);

NextJs Support

Beow is the sample code if you using NextJs.

import withRedux from 'next-redux-wrapper';
import createStore from 'react-redux-thunk-store/storeCreator';
//Using the react-redux Provider
import { Provider } from 'react-redux';
//Your reducers but not combineReducers
import reducers from './reducers';

const makeStore = () => createStore(reducers, initialState);

export default withRedux(makeStore)(
  class extends App {
    render() {
      <Provider store={store}>
        <Component {...pageProps} />
      </Provider>;
    }
  }
);

Properties

1. reducers Required

This is required property which proviced an object contains all your reducers.

2. initialState option

Provide the initialState to the Redux store.

3. middleWares option

Provide the custom middle-wares to the Redux store.

1.0.1

5 years ago

1.0.0

5 years ago

0.0.9

5 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago