next-redux

0.1.1 • Public • Published

next-redux

Next.js Redux coupling

npm no dependencies


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)

File: pages/_app.js

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)

File: pages/_app.js

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    42
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    42
  • 0.1.0
    0
  • 0.0.5
    0
  • 0.0.4
    0
  • 0.0.3
    0

Package Sidebar

Install

npm i next-redux

Weekly Downloads

42

Version

0.1.1

License

MIT

Unpacked Size

4.47 kB

Total Files

4

Last publish

Collaborators

  • mvasilkov