Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Add a CHANGELOG and update the README #90

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

## [Unreleased]

Update to the new history API (#89)

## [1.0.0] - 2015-12-07

### Breaking

The `updatePath(path, noRouterUpdate)` action creator has been removed in favor of
`pushPath(path, state, avoidRouterUpdate)` and `replacePath(path, state, avoidRouterUpdate)`
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ npm install redux-simple-router

[redux-router](https://github.com/rackt/redux-router) is another
project which solves the same problem. However, it's far more complex.
Just look at this code: the whole thing is only 68 lines of JS.
Just look at this code: the whole thing is only a small JS file.
redux-router is much bigger and more complex.

That said, redux-router is a fine project and has features this
Expand Down Expand Up @@ -154,15 +154,26 @@ piece of state must be named `routing`** (unless you provide a custom

### `UPDATE_PATH`

An action type that you can listen for in your reducers.
An action type that you can listen for in your reducers to be notified of
route updates.

### `updatePath(path, noRouterUpdate)`
### `pushPath(path, state, { avoidRouterUpdate = false } = {})`

An action creator that you can use to update the current URL. Just
pass it a string like `/foo/bar?param=5`.
An action creator that you can use to update the current URL and update the
browser history. Just pass it a string like `/foo/bar?param=5` as the
`path` argument.

The `noRouterUpdate`, if `true`, will stop react-router from reacting
to this and all future URL changes. Pass `false` to make it start
reacting again. This is useful if replaying snapshots while using the
You can optionally pass a state to this action creator to update the state of the
current route.

The `avoidRouterUpdate`, if `true`, will stop react-router from reacting
to this URL change. This is useful if replaying snapshots while using the
`forceRefresh` option of the browser history which forces full
reloads. It's a rare edge case.

### `replacePath(path, state, { avoidRouterUpdate = false } = {})`

An action creator that you can use to replace the current URL without updating
the browser history.

The `state` and the `avoidRouterUpdate` parameters work just like `pushPath`.