Skip to content

Commit

Permalink
add explanation for useNavState
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanglasmeyer committed Jun 11, 2016
1 parent 2fa52cc commit 86af827
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions modules/nativeHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ import type {

const { PUSH: HISTORY_PUSH, REPLACE: HISTORY_REPLACE } = Actions;

/* eslint-disable max-len */
/**
* This enhances a given history
* (see https://github.com/ReactJSTraining/history/blob/master/docs/Glossary.md#createhistoryenhancer )
* by adding the methods `create(Pop|TransitionTo|Push|Replace)`.
* These are used in RouterContext::getChildContext to produce the actual methods (`pop`, `transitionTo` etc.)
* with closured information about the current routing state
* (e.g. the current `navigationState` or `location`)
*/
/* eslint-enable max-len */
const useNavState = (createHistory: Function) => (options = {}) => {
const {
replace: baseReplace,
Expand Down

0 comments on commit 86af827

Please sign in to comment.