-
Notifications
You must be signed in to change notification settings - Fork 47
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
BREAKING CHANGE: remove built-in support for react native async storage #76
Conversation
111b5f7
to
f1ab6ba
Compare
} catch (ex) { | ||
console.error(ex); | ||
} | ||
} | ||
|
||
public async get(name: string) { | ||
public get(name: string) { |
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.
Even though we do not need async
marker on this method i think I would prefer to have it, to make sure we remember to await the get method also, sense this will be the default implementation. I can easily see myself (or someone else) forgetting the "await" in the calling code, if this method is not marked as async in the default implementation. This will lead to bugs, only visible when using a custom store.
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.
Evening! No problem to get rid of async to but U've defined interface which is Promise based :)
// src/storage-provider.ts
export default interface IStorageProvider {
save: (name: string, data: any) => Promise<void>;
get: (name: string) => Promise<any>;
}
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.
good point :D
This looks really good. It will also make sense for us to push an update to the react SDK, after we release this one @FredrikOseberg ! |
9166b98
to
382a326
Compare
(rebasing ☝️) |
382a326
to
f58fc33
Compare
@ivarconr ping 😅 |
[Breaking Change] v2
Removing built-in support for react-native (will become optional as custom storageProvider provided by developer itself)
react-native-async-storage
which fallbacks to window.localStorage I just used window.localStorageKind regards
Dziczek!