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

Split localStorage and sessionStorage #16

Open
ivan-kleshnin opened this issue May 11, 2016 · 2 comments
Open

Split localStorage and sessionStorage #16

ivan-kleshnin opened this issue May 11, 2016 · 2 comments

Comments

@ivan-kleshnin
Copy link

ivan-kleshnin commented May 11, 2016

Wouldn't it be better to split two targets onto two different drivers?

  1. I don't think that amount of if checks (we have now in the code) is better than possible code duplication.
  2. sessionStorage and localStorage have different level of support among browsers.
    So library can work with one and not work with another. Changing driver factory implies this more than
    changing key.
  3. "Controlling argument" is kinda of bad programming style.
  4. CycleJS driver is about side effect type. LocalStorage and SessionStorage are two different targets. They may have considerably different implementation, performance characteristics, etc.
    Two drivers better describe what goes on in reality.
@kahlil
Copy link
Collaborator

kahlil commented May 22, 2016

Since I implemented this driver per @staltz's requirements and I am fine with how it works I would ask you to discuss this directly with him.

@jvanbruegge
Copy link
Member

My storage driver (cyclejs-storage) supports both, seperated use and use as single driver

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

No branches or pull requests

3 participants