- [x] Support simple types (numbers, strings, booleans) - [x] Support objects - [x] Support arrays - Return array even if single item - Arrays of simple types - Arrays of objects - [x] Handle datatype changing when only a single vs multiple selected (ex. select with a single vs multiple values) - [ ] Provide better errors when config not found (at least include param name) - [ ] Support updating single param with `queryParamsStore` - Either support property and only update those with keys passed (require null / undefined to remove) or expose function from store to set - [ ] Support specifying `pushState` (browser back) vs `replaceState` - [ ] Attempt to guess paramType based on default value and/or current params set? - Might be confusing when breaks in certain conditions - [ ] Consider supporting `Number` and `[Number]` along with `'number'` and `'number[]'` (etc)? - Support both formats? - What about `json` (`JSON`), `object` (`Object`)? - What about `date` vs `datetime`? - Maybe `Date` is bound to `datetime` and `date` is handled by passing in an implementation object with encode/decode (see below) - Support a custom format in the future (UTC date vs local date, etc) - Maybe passing in an implementation object with encode/decode (see below) - [ ] Consider supporting explicit object with `{encode: ..., decode: ....}`? - [ ] Differentiate between null and undefined - Should only undefined delete the value (null is persisted)? Example: active/inactive/all toggles ## Useful links - https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams - Svelte - https://stackoverflow.com/questions/57181704/svelte-components-store-load-state-into-from-url-hash-parameters - React - https://github.com/pbeshai/use-query-params - https://github.com/pbeshai/serialize-query-params - https://github.com/rudyhuynh/use-url-search-params - [Using React Hooks to sync your component state and the URL Query string](https://medium.com/swlh/using-react-hooks-to-sync-your-component-state-with-the-url-query-string-81ccdfcb174f) - [The Easiest Way to Use Query Parameters in React](https://dev.to/brettfishy/the-easiest-way-to-use-query-parameters-in-react-1ioe) - Libraries - https://github.com/sindresorhus/query-string (6.3k) - https://github.com/ljharb/qs (10.2k - 27.9k) - https://github.com/lukeed/qss (757b)
queryParamsStorepushState(browser back) vsreplaceStateNumberand[Number]along with'number'and'number[]'(etc)?json(JSON),object(Object)?datevsdatetime?Dateis bound todatetimeanddateis handled by passing in an implementation object with encode/decode (see below){encode: ..., decode: ....}?Useful links