mirror of
https://github.com/strapi/strapi.git
synced 2025-11-09 06:40:42 +00:00
26 lines
554 B
JavaScript
26 lines
554 B
JavaScript
|
|
// import { createSelector } from 'reselect';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Direct selector to the list state domain
|
||
|
|
*/
|
||
|
|
|
||
|
|
// const selectGlobalDomain = () => state => state.get('global');
|
||
|
|
|
||
|
|
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 };
|