Skip to content

Lizhooh/redux-store-init

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published