-
Notifications
You must be signed in to change notification settings - Fork 0
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 support for chrome.storage backed configuration store. #63
Conversation
0316318
to
136ce0b
Compare
@@ -83,7 +87,7 @@ export interface IClientConfig { | |||
export { IAssignmentLogger, IAssignmentEvent, IEppoClient } from '@eppo/js-client-sdk-common'; | |||
|
|||
// Instantiate the configuration store with memory-only implementation. | |||
const configurationStore = configurationStorageFactory(undefined, true); | |||
const configurationStore = configurationStorageFactory({ forceMemoryOnly: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this API more - to me it reads more clearly what is being performed.
chromeStorage: hasChromeStorage() && chrome.storage.local, | ||
windowLocalStorage: hasWindowLocalStorage() && window.localStorage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO not great to have to pass these in with the hasChromeStorage
protection but we don't know if the APIs are available otherwise.
labels: mergeable
Fixes: #issue
Motivation and Context
Users in the chrome extension environment do not have access to
localStorage
but need to persist configuration between sessions.Description
chrome.storage
backedAsyncStore
How has this been tested?