web
web copied to clipboard
feat(useStorageValue): add custom parse and stringify functions to options
Overview
parse and stringify options have been added to useStorageValue to allow a custom parse and stringify to be used in place of the default JSON based parse/stringify.
Sometimes a custom format or a custom replacer function are needed for storing values in localstorage.
Checklist
- [x] Have you read contribution guideline?
- [x] Does the code have comments in hard-to-understand areas?
- [x] Is there an existing issue for this PR?
- #942
- [x] Have the files been linted and formatted?
- [x] Have the docs been updated?
- [x] Have the tests been added to cover the changes?
- [x] Have you run the tests locally to confirm they pass?