-
Notifications
You must be signed in to change notification settings - Fork 1
Step 2
Isaac Pak edited this page Dec 2, 2017
·
3 revisions
Wherever you create your store include the client. This is where we will instantiate the client and pass it in the middleware.
// app root
// services
// socketio
// index.js
// store.js
// store.js
import Socket from './services/socketio/index.js'
import {createStore, applyMiddleware} from 'redux'
import ioMiddleware from 'redux-socketio'
const SocketClient = new Socket()
const store = createStore(
...
applyMiddleware(ioMiddleware(SocketClient))
...
)
...
export default store