# redux-history

> Connect history to redux.

Latest version **1.0.2** (published 2016-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-history
pnpm add redux-history
yarn add redux-history
bun add redux-history
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-01-02 |
| First published | 2015-12-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Ezekiel Chentnik |
| Maintainers | ezekielchentnik |
| Keywords | redux, flux |

## Links

- npm: https://www.npmjs.com/package/redux-history
- Repository: https://github.com/ezekielchentnik/redux-history
- Issues: https://github.com/ezekielchentnik/redux-history/issues
- npm.io page: https://npm.io/package/redux-history

## Dependencies (1)

- [history](https://npm.io/package/history.md) ^1.17.0

## Alternatives

- [@reckona/mreact-store](https://npm.io/package/@reckona/mreact-store.md) — 976 weekly downloads
- [regular-state](https://npm.io/package/regular-state.md) — 410 weekly downloads
- [@pacote/flux-actions](https://npm.io/package/@pacote/flux-actions.md) — 65 weekly downloads
- [@pilotlab/lux-debug](https://npm.io/package/@pilotlab/lux-debug.md) — 39 weekly downloads
- [vue-persist-state](https://npm.io/package/vue-persist-state.md) — 19 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-01-02
- 1.0.1 — 2015-12-31
- 1.0.0 — 2015-12-29

## README

Redux History
=============

Connect the [history api](https://github.com/rackt/history) to redux.  Redux History lets you sync redux with rackt history, giving you access to the current [location object](https://github.com/rackt/history/blob/master/docs/Location.md) in your reducers, optionally including [URL queries](https://github.com/rackt/history/blob/master/docs/QuerySupport.md).  It's meant to be a dead simple enhancement for redux, it will also work nicely with react-router.

## Installation

```
npm install --save redux-history history
```

To enable Redux History, use `connectHistory()` inside your main entry point:

```js
import React from 'react';
import { render } from 'react-dom';
import configureStore from './store/configureStore';
import Root from './containers/Root';
import { connectHistory } from 'redux-history'; 
import { createHistory, useQueries } from 'history';

const store = configureStore();
const history = useQueries(createHistory)();
const unconnectHistory = connectHistory(history, store);

render(
  <Root store={store} />,
  document.getElementById('root')
);
```

in your root reducer
```js
import {combineReducers} from 'redux';
import { locationReducer } from 'redux-history';

const rootReducer = combineReducers({
  location: locationReducer
});
```

## Usage

```js

// examples with:
// with history.push, history.replace
// with custom actions, custom reducers
// with react-router

```

## License

MIT

---
_Source: https://npm.io/package/redux-history · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
