redux-router-kit
Advanced tools
Comparing version 0.0.8 to 0.0.9
@@ -55,3 +55,3 @@ 'use strict'; | ||
state = _extends({}, state, { | ||
previous: state.current, | ||
previous: !_payload.replace && state.current || state.previous, | ||
current: _extends({}, _meta.state, { | ||
@@ -58,0 +58,0 @@ _routeId: _meta._routeId, |
{ | ||
"name": "redux-router-kit", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "Routing tools for Redux/React", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -42,3 +42,3 @@ import ActionTypes from './ActionTypes'; | ||
...state, | ||
previous: state.current, | ||
previous: (!payload.replace && state.current) || state.previous, | ||
current: { | ||
@@ -45,0 +45,0 @@ ...meta.state, |
@@ -10,3 +10,5 @@ import test from 'ava'; | ||
type: options.type, | ||
payload: {}, | ||
payload: { | ||
replace: !!options.replace | ||
}, | ||
meta: { | ||
@@ -85,1 +87,20 @@ state: {}, | ||
}); | ||
test('replace', t => { | ||
let state = reducer(); | ||
state = reducer(state, createRouteToAction({ | ||
_routeId: 1, | ||
url: '/users' | ||
})); | ||
state = reducer(state, createRouteToAction({ | ||
_routeId: 2, | ||
url: '/users/joe' | ||
})); | ||
state = reducer(state, createRouteToAction({ | ||
_routeId: 3, | ||
url: '/users/joseph', | ||
replace: true | ||
})); | ||
t.is(state.current.url, '/users/joseph'); | ||
t.is(state.previous.url, '/users'); | ||
}); |
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
371763
7859