Skip to content

[feat] storePersistor option for createClient to pass through for createStore calls #542

@509dave16

Description

@509dave16

Summary

@segment/sovran-react-native's export createStore has a persist option that allows for you to provide a Persistor. This is great for being able to leverage a faster storage library like MMKV.

However the createClient export of @segment/analytics-react-native does not pass through any config options to it's SovranStorage class which makes createStore function calls. Except for writeKey that is which maps to storeId in the SovranStorage class.

Proposed Solution

  1. createClient export's Config argument should include an option for storePersistor. Which will match the Persistor interface of @segment/sovran-react-native
  2. SovranStorage class needs either a second argument for storePersistor or it needs to have it own Config interface for the argument to support a storeId and storePersistor options.
  3. All createStore calls in SovranStorage class must pass persistor property in the persist object option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions