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

Add storage opt in hub. Can now configure localStorage or sessionStorage #54

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

Conversation

cyrilchapon
Copy link

Hello.

I made this because we needed support for sessionStorage option.

Changes :

  • Hub() constructor now accepts a single opts arguments
    • opts.permissions behaves like previously permissions
    • opts.storage is added. Can be one of window.localStorage and window.sessionStorage (or any object with the same API, I guess). It defaults to window.localStorage

Compat checks with window.localStorage are now made to opts.storage

TODO : Some tests should be added to ensure

  • Chosen storage is respected
  • Unprovided storage defaults to localStorage
  • Everything works like excepted

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

1 participant