diff options
author | Noah Loomans <noahloomans@gmail.com> | 2018-07-06 16:51:41 +0200 |
---|---|---|
committer | Noah Loomans <noahloomans@gmail.com> | 2018-07-06 17:01:03 +0200 |
commit | 53bb2628748e5967514251606d1fece9f4388b35 (patch) | |
tree | e85ea68ce281cf6abb724843972a49a6ad4ca097 /src/client/react/lib | |
parent | ebb14ffc54670c8e2cbeba18eac238965eee4e81 (diff) |
client: Switch to connected-react-router
Diffstat (limited to 'src/client/react/lib')
-rw-r--r-- | src/client/react/lib/getHistory.js | 35 | ||||
-rw-r--r-- | src/client/react/lib/url.js | 11 |
2 files changed, 0 insertions, 46 deletions
diff --git a/src/client/react/lib/getHistory.js b/src/client/react/lib/getHistory.js deleted file mode 100644 index daa984b..0000000 --- a/src/client/react/lib/getHistory.js +++ /dev/null @@ -1,35 +0,0 @@ -import { - weekFromLocation, - userFromLocation, - makeUpdatePathname, - makeUpdateQuery, -} from './url'; - -/** - * Make a getHistory function. This function is used in index.js when creating - * the redux store. - * @param {history} history - * The history object from the `history` package. - * There may only be a single shared history object in the application, which - * is why it's delivered from `../index.js`. - */ -export default function makeGetHistory(history) { - /** - * Get a collection of helpers for common browser history interactions, and a - * collection of precalculated values from the address bar. This function is - * used in actions. - */ - return function getHistory() { - const user = userFromLocation(history.location); - const week = weekFromLocation(history.location); - const updatePathname = makeUpdatePathname(history); - const updateQuery = makeUpdateQuery(history); - - return { - user, - week, - updatePathname, - updateQuery, - }; - }; -} diff --git a/src/client/react/lib/url.js b/src/client/react/lib/url.js index 442e5eb..bb5b483 100644 --- a/src/client/react/lib/url.js +++ b/src/client/react/lib/url.js @@ -71,17 +71,6 @@ export function makeSetWeek(history) { }; } -export function makeUpdatePathname(history) { - return function updatePathname(pathname) { - const query = history.location.search; - if (pathname) { - history.push(`/${pathname}${query}`); - } else { - history.push(`/${query}`); - } - }; -} - export function makeUpdateQuery(history) { return function updateQuery(newQuery) { const query = queryString.stringify({ |