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

If localStorage is not available, use a in-memory none expiring assig… #71

Closed
wants to merge 1 commit into from

Conversation

leoromanovsky
Copy link
Member

…nment cache (FF-2110)


labels: mergeable

Fixes: #issue

Motivation and Context

When init is called, a localStorage assignment cache is created. However if no localStorage is available it always returns non-cachable return values, effectively being no cache. This is going to happen on chrome extensions and other environments without a localStorage.

Description

  • If no localStorage is available, create an in-memory assignment cache. This is an improvement over the current behavior as at least there will be some caching happening, even though it is reset each session.
  • extracted helper methods in environment.ts
  • moved assignment cache files into own directory

How has this been tested?

Comment on lines -9 to -11
if (!hasWindowLocalStorage()) {
return false;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO no need for these methods - the class should only be instantiated from the factory and when localStorage is detected. If not, throwing an exception is "good" behavior so the end-user uses the more appropriate class.

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