-
Notifications
You must be signed in to change notification settings - Fork 9
feat: Remove @react-native-async-storage/async-storage dependency #29
Comments
@oscb @alanjcharles would you accept a PR adding the support for different storage providers instead of relying on If so I can open a PR adding this functionality. |
Hi, We used the option You mentioned a in-memory default persistor. Any news on this? |
Is this project maintained anymore? |
To expand on @georgeilas-tem's solution, an MMKV store persistor can be written like: const segmentMMKV = new MMKV()
export const segmentClient = createClient({
storePersistor: {
get: async <T>(key: string) => segmentMMKV.getString(key) as T,
set: async <T>(key: string, state: T) =>
segmentMMKV.set(key, JSON.stringify(state)),
},
trackAppLifecycleEvents: true,
writeKey: config.segment.writeKey,
}) However, as @georgeilas-tem mentioned, we still need to keep I see that this package hasn't been touched in 10 months, yet is still a mandatory requirement for @oscb @alanjcharles Can you please provide a response on this issue? |
This change was just merged: segmentio/analytics-react-native#779 This repository will be archived now. We migrated this into the |
This
@react-native-async-storage/async-storage
dependency is hard coded. I know thatAsyncStorage
API fromreact-native
is deprecated. But ifsovran-react-native
could transition away from using@react-native-async-storage/async-storage
then that would be one less dependency to install. Especially if a user/client is using a different store persistor that is not based on@react-native-async-storage/async-storage
(e.g. MMKV): segmentio/analytics-react-native#549I know there may have been reasons for transitioning away from
react-native
's apiAsyncStorage
. If going back to that would break functionality in some scenarios, then maybe we could either:createStore
's argumentconfig
of typeStorageConfig
be required as well as thepersist
sub-property of typePersistenceConfig
and it's sub-propertypersistor
. And then document how to use@react-native-async-storage/async-storage
as a dependency. Could also document on how to use MMKV.The text was updated successfully, but these errors were encountered: