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
createClient export's Config argument should include an option for storePersistor. Which will match the Persistor interface of @segment/sovran-react-native
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.
- All
createStore calls in SovranStorage class must pass persistor property in the persist object option.
Summary
@segment/sovran-react-native's export createStore has apersistoption that allows for you to provide aPersistor. This is great for being able to leverage a faster storage library like MMKV.However the
createClientexport of@segment/analytics-react-nativedoes not pass through anyconfigoptions to it'sSovranStorageclass which makescreateStorefunction calls. Except forwriteKeythat is which maps tostoreIdin theSovranStorageclass.Proposed Solution
createClientexport'sConfigargument should include an option forstorePersistor. Which will match thePersistorinterface of@segment/sovran-react-nativeSovranStorageclass needs either a second argument forstorePersistoror it needs to have it ownConfiginterface for the argument to support astoreIdandstorePersistoroptions.createStorecalls inSovranStorageclass must passpersistorproperty in thepersistobject option.