Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sessionStorage and localStorage should have similar behavior, their only difference is where the data is being stored and it's persistence which should be abstracted for this library. #979

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

iamrommel
Copy link

Description

sessionStorage and localStorage should have similar behavior, their only difference is where the data is being stored and it's persistence which should be abstracted for this library.

Type of change

  • Breaking change, The signature/arguments follows the useLocalStorage, this is breaking changes, because the previous last argument is just a boolean "raw", which i change it to object "options"
  • New feature, added the useStorage, as the base for sessionStorage, localStorage, or even "whatEverStorage" that follows the signature of localStorage
  • New feature, Added the sessionStorage unit test
  • New feature, Update the docs that describe about the config changes, for raw, serializer, de-serializer
  • Bug fix, Removed the single-quote in lint script, to properly find the correct files and folder, this is not related to the changes, but the lint command does not find the files with single qoute, i tried with bash and command terminals both does not work there (we can discuss more on this if there is a need to)

Checklist

  • Read the Contributing Guide
  • Perform a code self-review
  • Comment the code, particularly in hard-to-understand areas
  • Add documentation
  • Add hook's story at Storybook
  • Cover changes with tests
  • Ensure the test suite passes (yarn test)
  • Provide 100% tests coverage
  • Make sure code lints (yarn lint). Fix it with yarn lint:fix in case of failure.
  • Make sure types are fine (yarn lint:types).

…es and folder

--uses the base storage, that we can re-used for localStorage and sessionStorage, because they have he same signature
-Added the sessionStorage unit test
-Update the docs that describe about the config changes, for raw, serializer, de-serializer
@iamrommel iamrommel changed the title --escape double quote in lint script to properly find the correct fil… sessionStorage and localStorage should have similar behavior, their only difference is where the data is being stored and it's persistence which should be abstracted for this library. Feb 16, 2020
@nspaeth
Copy link

nspaeth commented Mar 4, 2020

Could you put this pull request into a separate feature branch as per the Contributing Guide?

I would like to add some additional functionality, but it conflicts with the existing v14.0 branch.

nspaeth pushed a commit to nspaeth/react-use that referenced this pull request Mar 5, 2020
Fixes streamich#785 - useLocalStorage not updating if many components watch the same key

This pull request depends on pull requests streamich#1021 streamich#979
nspaeth pushed a commit to nspaeth/react-use that referenced this pull request Mar 5, 2020
Fixes streamich#785 - useLocalStorage not updating if many components watch the same key

This pull request depends on pull requests streamich#1021 streamich#979
nspaeth pushed a commit to nspaeth/react-use that referenced this pull request Mar 5, 2020
Fixes streamich#785 - useLocalStorage not updating if many components watch the same key

This pull request depends on pull requests streamich#1021 streamich#979
nspaeth pushed a commit to nspaeth/react-use that referenced this pull request Mar 5, 2020
Fixes streamich#785 - useLocalStorage not updating if many components watch the same key

Previously pr streamich#786 addressed this issue by ensuring that other components
watching the key would see new updates, however, those updates would not be
rendered until something else triggered a re-render. This pr resolves that issue.

This pull request depends on pull requests streamich#1021 streamich#979
nspaeth pushed a commit to nspaeth/react-use that referenced this pull request Mar 5, 2020
Fixes streamich#785 - useLocalStorage not updating if many components watch the same key

Previously pr streamich#786 addressed this issue by ensuring that other components
watching the key would see new updates, however, those updates would not be
rendered until something else triggered a re-render. This pr resolves that issue.

This pull request depends on pull requests streamich#1021 streamich#979
nspaeth pushed a commit to nspaeth/react-use that referenced this pull request Mar 6, 2020
Fixes streamich#785 - useLocalStorage not updating if many components watch the same key

Previously pr streamich#786 addressed this issue by ensuring that other components
watching the key would see new updates, however, those updates would not be
rendered until something else triggered a re-render. This pr resolves that issue.

This pull request depends on pull requests streamich#1021 streamich#979
nspaeth pushed a commit to nspaeth/react-use that referenced this pull request Mar 6, 2020
Fixes streamich#785 - useLocalStorage not updating if many components watch the same key

Previously pr streamich#786 addressed this issue by ensuring that other components
watching the key would see new updates, however, those updates would not be
rendered until something else triggered a re-render. This pr resolves that issue.

This pull request depends on pull requests streamich#1021 streamich#979
@streamich streamich changed the base branch from v14.0 to master May 16, 2020 13:59
nspaeth pushed a commit to nspaeth/react-use that referenced this pull request Jun 20, 2020
Fixes streamich#785 - useLocalStorage not updating if many components watch the same key

Previously pr streamich#786 addressed this issue by ensuring that other components
watching the key would see new updates, however, those updates would not be
rendered until something else triggered a re-render. This pr resolves that issue.

This pull request depends on pull requests streamich#1021 streamich#979
nspaeth pushed a commit to nspaeth/react-use that referenced this pull request Jul 6, 2020
Fixes streamich#785 - useLocalStorage not updating if many components watch the same key

Previously pr streamich#786 addressed this issue by ensuring that other components
watching the key would see new updates, however, those updates would not be
rendered until something else triggered a re-render. This pr resolves that issue.

This pull request depends on pull requests streamich#1021 streamich#979
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants