react-redux-saga-router
Advanced tools
Comparing version 0.3.6 to 0.4.0
@@ -75,4 +75,4 @@ 'use strict'; | ||
key: 'getState', | ||
value: function getState(params) { | ||
return this.stateFromParams(params); | ||
value: function getState(params, state) { | ||
return this.stateFromParams(params, state); | ||
} | ||
@@ -90,3 +90,3 @@ }, { | ||
var oldState = selectors.oldState(state, route); | ||
var newState = this.getState(params); | ||
var newState = this.getState(params, state); | ||
var changes = RouteManager.changed(oldState, newState); | ||
@@ -93,0 +93,0 @@ return changes.map(function (key) { |
@@ -23,3 +23,5 @@ 'use strict'; | ||
{ style: { display: 'none' } }, | ||
children && _react2.default.cloneElement(children, { dispatch: dispatch }) | ||
children && _react.Children.map(children, function (child) { | ||
return _react2.default.cloneElement(child, { dispatch: dispatch }); | ||
}) | ||
); | ||
@@ -26,0 +28,0 @@ } |
{ | ||
"name": "react-redux-saga-router", | ||
"version": "0.3.6", | ||
"version": "0.4.0", | ||
"description": "elegant powerful routing based on the simplicity of storing url as state", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -34,4 +34,4 @@ import RouteParser from 'route-parser' | ||
getState(params) { | ||
return this.stateFromParams(params) | ||
getState(params, state) { | ||
return this.stateFromParams(params, state) | ||
} | ||
@@ -51,3 +51,3 @@ | ||
const oldState = selectors.oldState(state, route) | ||
const newState = this.getState(params) | ||
const newState = this.getState(params, state) | ||
const changes = RouteManager.changed(oldState, newState) | ||
@@ -54,0 +54,0 @@ return changes.map(key => this.update[key](newState[key])) |
@@ -1,6 +0,6 @@ | ||
import React, { PropTypes } from 'react' | ||
import React, { PropTypes, Children } from 'react' | ||
export function RawRoutes({ dispatch, children }) { | ||
return (<div style={{ display: 'none' }}> | ||
{children && React.cloneElement(children, { dispatch })} | ||
{children && Children.map(children, child => React.cloneElement(child, { dispatch }))} | ||
</div>) | ||
@@ -7,0 +7,0 @@ } |
92830
1811