Closed GregoryCollett closed 3 years ago
Hi @GregoryCollett, thanks for your PR.
Since even expo is now compatible with react-native-async-storage/async-storage https://docs.expo.io/versions/latest/sdk/async-storage/
I would change createStorage.native.ts like this:
import { ICacheStorage } from './CacheTypes';
import AsyncStorage from '@react-native-async-storage/async-storage';
/**
* I had to restore the abstraction above the AsyncStorage for a
* typescript problem in the multiGet (readonly parameter)
*
*/
export function createStorage(_type): ICacheStorage {
return {
multiRemove: (keys) => AsyncStorage.multiRemove(keys),
multiGet: (keys) => AsyncStorage.multiGet(keys),
getAllKeys: () => AsyncStorage.getAllKeys(),
multiSet: (items) => AsyncStorage.multiSet(items),
setItem: (key, value) => AsyncStorage.setItem(key, value),
removeItem: (key) => AsyncStorage.removeItem(key),
getItem: (key) => AsyncStorage.getItem(key),
} as ICacheStorage;
}
What do you think about it?
Hi @morrys,
Great shout, I have updated the pr to reflect this change.
Thanks!
thank you for your contribution 💯
I will release the libraries as soon as possible.
Can I ask you which library are you using?
@react-native-community/async-storage is now deprecated.