Skip to content
This repository was archived by the owner on Mar 13, 2023. It is now read-only.
This repository was archived by the owner on Mar 13, 2023. It is now read-only.

feat: Remove @react-native-async-storage/async-storage dependency #29

@509dave16

Description

@509dave16

This @react-native-async-storage/async-storage dependency is hard coded. I know that AsyncStorage API from react-native is deprecated. But if sovran-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#549

I know there may have been reasons for transitioning away from react-native's api AsyncStorage. If going back to that would break functionality in some scenarios, then maybe we could either:

  1. Have default be an "in-memory" persistor like in this unit test here: https://github.com/segmentio/analytics-react-native/blob/1f960f04cc53fd8c3dbe07aa9edd05aa7cf388d9/packages/core/src/storage/__tests__/sovranStorage.test.ts#L109-L117
  2. Or make createStore's argument config of type StorageConfig be required as well as the persist sub-property of type PersistenceConfig and it's sub-property persistor. And then document how to use @react-native-async-storage/async-storage as a dependency. Could also document on how to use MMKV.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions