Service middleware for redux
npm install inst-redux-service-middleware1. While creating your store, register your services as key/value pairs
with the service middleware constructor:
```
applyMiddleware(
createServiceMiddleware({
myKey: myService,
myOtherKey: myOtherService
})
)
2. In your action creator, dispatch an action with the following shape:
``
{
type: serviceMiddleware.CALL_SERVICE
payload: {
service: 'myKey'
method: 'methodName'
args: [arg1, arg2]
}
}
Subsequent calls to dispatch with your action creator will return themyService.methodName(arg1, arg2)`
result of calling