Forked from DimitryDushkin/react-router-queyry-utils.js
Created
June 18, 2018 15:05
-
-
Save dyaa/f2295e107a569e4e5e33255bb2aabcf4 to your computer and use it in GitHub Desktop.
Revisions
-
DimitryDushkin revised this gist
Mar 7, 2017 . 1 changed file with 9 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,15 @@ export const addQuery = (query) => { browserHistory.push(location); }; /** * @param {Object} query */ export const replaceQuery = (query) => { const location = Object.assign({}, browserHistory.getCurrentLocation()); Object.assign(location.query, query); browserHistory.replace(location); } /** * @param {...String} queryNames */ -
DimitryDushkin renamed this gist
Feb 8, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
DimitryDushkin created this gist
Feb 8, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ import { browserHistory } from 'react-router'; /** * @param {Object} query */ export const addQuery = (query) => { const location = Object.assign({}, browserHistory.getCurrentLocation()); Object.assign(location.query, query); browserHistory.push(location); }; /** * @param {...String} queryNames */ export const removeQuery = (...queryNames) => { const location = Object.assign({}, browserHistory.getCurrentLocation()); queryNames.forEach(q => delete location.query[q]); browserHistory.push(location); };