flux-router-component
Advanced tools
Comparing version 0.6.0 to 0.6.1
# NavLink | ||
`NavLink` is the a React component for navigational links. When the link is clicked, NavLink will dispatch `NAVIGATE` action to flux dispatcher. The dispatcher can then dispatch the action to the stores that can handle it. | ||
`NavLink` is the a React component for navigational links. When the link is clicked, NavLink will execute a [navigateAction]('./navigateAction.md'). Stores can register for `CHANGE_ROUTE_SUCCESS` handlers if they are interested | ||
in navigation events. | ||
@@ -4,0 +5,0 @@ | Prop Name | Prop Type | Description | |
@@ -10,2 +10,6 @@ /** | ||
function isUndefined(v) { | ||
return v === undefined; | ||
} | ||
/** | ||
@@ -78,12 +82,5 @@ * This only supports pushState for the browsers with native pushState support. | ||
if (this._hasPushState) { | ||
try { | ||
// not calling pushState(state, title, url), because | ||
// some browsers update url with '/undefined' if url is undefined | ||
win.history.pushState.apply(win.history, arguments); | ||
} catch (error) { | ||
// firefox 35 requires 3 args for pushState | ||
if (arguments.length < 3) { | ||
win.history.pushState(state, title, url); | ||
} | ||
} | ||
title = isUndefined(title) ? win.document.title : title; | ||
url = isUndefined(url) ? win.location.href : url; | ||
win.history.pushState(state, title, url); | ||
this.setTitle(title); | ||
@@ -105,12 +102,5 @@ } else if (url) { | ||
if (this._hasPushState) { | ||
try { | ||
// not calling pushState(state, title, url), because | ||
// some browsers update url with '/undefined' if url is undefined | ||
win.history.replaceState.apply(win.history, arguments); | ||
} catch (error) { | ||
// firefox 35 requires 3 args for replaceState | ||
if (arguments.length < 3) { | ||
win.history.replaceState(state, title, url); | ||
} | ||
} | ||
title = isUndefined(title) ? win.document.title : title; | ||
url = isUndefined(url) ? win.location.href : url; | ||
win.history.replaceState(state, title, url); | ||
this.setTitle(title); | ||
@@ -117,0 +107,0 @@ } else if (url) { |
{ | ||
"name": "flux-router-component", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Router-related React component and mixin for applications with Fluxible architecture", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
# flux-router-component | ||
# flux-router-component | ||
@@ -9,3 +9,3 @@ [![npm version](https://badge.fury.io/js/flux-router-component.svg)](http://badge.fury.io/js/flux-router-component) | ||
Provides navigational React components (`NavLink`) and router mixin (`RouterMixin`) for applications built with [Flux](http://facebook.github.io/react/docs/flux-overview.html) architecture. Please check out [examples](https://github.com/yahoo/flux-router-component/tree/master/examples) of how to use these components. | ||
Provides navigational React components (`NavLink`), router mixin (`RouterMixin`), and action `navigateAction` for applications built with [Flux](http://facebook.github.io/react/docs/flux-overview.html) architecture. Please check out [examples](https://github.com/yahoo/flux-router-component/tree/master/examples) of how to use these components. | ||
@@ -38,3 +38,7 @@ ## Context and Expected Context Methods | ||
## navigateAction | ||
[Docs](https://github.com/yahoo/flux-router-component/blob/master/docs/navigateAction.md) | ||
## History Management (Browser Support and Hash-Based Routing) | ||
@@ -41,0 +45,0 @@ Considering different application needs and [different browser support levels for pushState](http://caniuse.com/#search=pushstate), this library provides the following options for browser history management: |
@@ -8,2 +8,6 @@ /** | ||
function isUndefined(v) { | ||
return v === undefined; | ||
} | ||
/** | ||
@@ -140,12 +144,5 @@ * @class HistoryWithHash | ||
if (this._hasPushState) { | ||
try { | ||
// not calling pushState(state, title, url), because | ||
// some browsers update url with '/undefined' if url is undefined | ||
history.pushState.apply(history, arguments); | ||
} catch (error) { | ||
// firefox 35 requires 3 args for pushState | ||
if (arguments.length < 3) { | ||
history.pushState(state, title, url); | ||
} | ||
} | ||
title = isUndefined(title) ? win.document.title : title; | ||
url = isUndefined(url) ? win.location.href : url; | ||
history.pushState(state, title, url); | ||
this.setTitle(title); | ||
@@ -187,12 +184,5 @@ } else if (url) { | ||
if (this._hasPushState) { | ||
try { | ||
// not calling replaceState(state, title, url), because | ||
// some browsers update url with '/undefined' if url is undefined | ||
history.replaceState.apply(history, arguments); | ||
} catch (error) { | ||
// firefox 35 requires 3 args for replaceState | ||
if (arguments.length < 3) { | ||
history.replaceState(state, title, url); | ||
} | ||
} | ||
title = isUndefined(title) ? win.document.title : title; | ||
url = isUndefined(url) ? win.location.href : url; | ||
history.replaceState(state, title, url); | ||
this.setTitle(title); | ||
@@ -199,0 +189,0 @@ } else if (url) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
201
44300
18
607