Skip to content

Commit

Permalink
ui: remove memoize from urlParamSelector (#226)
Browse files Browse the repository at this point in the history
* Fix bug in schedule shifts list to begin on current day
  • Loading branch information
KatieMSB authored and dctalbot committed Nov 26, 2019
1 parent 7381996 commit 0a92e9b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions web/src/app/selectors/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ export const urlSearchParamsSelector = createSelector(

export const urlParamSelector = createSelector(
urlSearchParamsSelector,
params =>
memoize((name, _default = null) => {
if (!params.has(name)) return _default
params => (name, _default = null) => {
if (!params.has(name)) return _default

if (Array.isArray(_default)) return params.getAll(name)
if (typeof _default === 'boolean') return Boolean(params.get(name))
if (typeof _default === 'number') return +params.get(name)
if (Array.isArray(_default)) return params.getAll(name)
if (typeof _default === 'boolean') return Boolean(params.get(name))
if (typeof _default === 'number') return +params.get(name)

return params.get(name)
}),
return params.get(name)
},
)

export const searchSelector = createSelector(urlParamSelector, params =>
Expand Down

0 comments on commit 0a92e9b

Please sign in to comment.