mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/RoboCommander.git
synced 2026-06-19 04:56:12 +00:00
Initial commit
This commit is contained in:
24
node_modules/react-router-redux/es/selectors.js
generated
vendored
Normal file
24
node_modules/react-router-redux/es/selectors.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import { matchPath } from 'react-router';
|
||||
|
||||
export var getLocation = function getLocation(state) {
|
||||
return state.router.location;
|
||||
};
|
||||
|
||||
export var createMatchSelector = function createMatchSelector(path) {
|
||||
var lastPathname = null;
|
||||
var lastMatch = null;
|
||||
return function (state) {
|
||||
var _ref = getLocation(state) || {},
|
||||
pathname = _ref.pathname;
|
||||
|
||||
if (pathname === lastPathname) {
|
||||
return lastMatch;
|
||||
}
|
||||
lastPathname = pathname;
|
||||
var match = matchPath(pathname, path);
|
||||
if (!match || !lastMatch || match.url !== lastMatch.url) {
|
||||
lastMatch = match;
|
||||
}
|
||||
return lastMatch;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user