mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 08:52:26 +00:00
21 lines
463 B
JavaScript
21 lines
463 B
JavaScript
// selectLocationState expects a plain JS object for the routing state
|
|
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,
|
|
};
|