next-redux
v0.1.1
Published
Next.js Redux coupling
Downloads
154
Maintainers
Readme
next-redux
Next.js Redux coupling
Installation
npm add redux react-redux next-redux
Synopsis
appWithRedux(reducer, [enhancer])
Usage
In the pages/_app.js file of your Next.js project:
import { combineReducers, applyMiddleware } from 'redux'
import { appWithRedux } from 'next-redux'
const reducer = combineReducers(/* Your reducers here */)
export default appWithRedux(reducer)
With redux-devtools and redux-thunk
import { combineReducers, applyMiddleware } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import thunkMiddleware from 'redux-thunk'
import { appWithRedux } from 'next-redux'
const reducer = combineReducers(/* Your reducers here */)
const enhancer = composeWithDevTools(applyMiddleware(thunkMiddleware))
export default appWithRedux(reducer, enhancer)
License
MIT