@vslutov/router-middleware
Version:
Router middleware for connected-react-router compatible with redux-batch-middleware
35 lines (26 loc) • 1.46 kB
Markdown
# @vslutov/router-middleware
[](https://travis-ci.org/vslutov/router-middleware)
[](https://badge.fury.io/js/%40vslutov%2Frouter-middleware)
[](https://greenkeeper.io/)
[](https://coveralls.io/github/vslutov/router-middleware?branch=master)
[](https://standardjs.com)
[](http://commitizen.github.io/cz-cli/)
Router middleware for [connected-react-router](https://github.com/supasate/connected-react-router) compatible with [redux-batch-middleware](https://github.com/mrydengren/redux-batch-middleware)
## Install
```sh
npm install @vslutov/router-middleware
```
## Code example
Drop-in replacement for router middleware from connected-react-router
Before:
```js
import { routerMiddleware } from 'connected-react-router'
```
After:
```js
import { routerMiddleware } from '@vslutov/router-middleware'
```
Now you can dispatch a batch of actions with history methods:
```js
store.dispatch([setSomeValues(value), push(someUrl)])
```