redux-store-init
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

redux-store-init

redux-store-init is a function used to initialize store.

install

npm install --save redux-store-init

use

import React from 'react';
import { hydrate } from 'react-dom';
import { Provider } from 'react-redux';
import * as reducers from './reducers';
import Store from 'redux-store-init';
 
import thunk from 'redux-thunk';
import logger from 'redux-diff-logger';
 
const store = Store({ reducers, devtool: true, applyMiddlewares: [thunk, logger] });
// or
// Store({ reducers, devtool: true }, [thunk, logger]);
 
hydrate(
    <Provider store={store}>
        <App />
    </Provider>,
    document.getElementById('app')
);

options

  • devtool: Boolean
  • reducers: Object
  • compose: Array
  • initState: Object
  • applyMiddlewares: Array

Package Sidebar

Install

npm i redux-store-init

Weekly Downloads

25

Version

2.2.0

License

MIT

Unpacked Size

3.59 kB

Total Files

4

Last publish

Collaborators

  • lizhooh