strapi/app/containers/App/selectors.js

21 lines
463 B
JavaScript
Raw Normal View History

2016-08-18 11:47:26 +02:00
// selectLocationState expects a plain JS object for the routing state
2016-08-18 11:41:13 +02:00
const selectLocationState = () => {
let prevRoutingState;
let prevRoutingStateJS;
return (state) => {
const routingState = state.get('route'); // or state.route
if (!routingState.equals(prevRoutingState)) {
prevRoutingState = routingState;
prevRoutingStateJS = routingState.toJS();
}
return prevRoutingStateJS;
};
};
export {
selectLocationState,
};