1.0.5 • Published 8 years ago
mantra-redux v1.0.5
Mantra Redux Middleware
Installation
npm install --save mantra-redux mantra-plus
Basic Usage
import redux from 'mantra-redux';
import thunk from 'redux-thunk';
import createLogger from 'redux-logger';
const logger = createLogger();
const middlewares = [
thunk,
logger,
Client.middleware(),
];
// create a Mantra app
const app = createApp(context);
// load middlewares before loading module
app.loadMiddlewares([
redux({
reducers: {
apollo: Client.reducer(),
},
middlewares,
}),
]);
// load all modules
app.loadModule(coreModule);
// initialize app
app.init();