@@ -26,22 +26,21 @@ import {
2626} from '../../core/persistence' ;
2727
2828/**
29- * Returns a persistence class that wraps AsyncStorage imported from
30- * `react-native` or `@react-native-community/async-storage`.
31- *
32- * Creates a "new"-able subclass on the fly that has an empty constructor.
33- *
34- * In the _getInstance() implementation (see src/core/persistence/index.ts),
35- * we expect each "externs.Persistence" object passed to us by the user to
36- * be able to be instantiated (as a class) using "new". That function also
37- * expects the constructor to be empty. Since ReactNativeStorage requires the
38- * underlying storage layer, we need to be able to create subclasses
39- * (closures, esentially) that have the storage layer but empty constructor.
29+ * Returns a persistence object that wraps AsyncStorage imported from
30+ * `react-native` or `@react-native-community/async-storage`, and can
31+ * be used in the persistence dependency field in {@link initializeAuth}.
32+ *
33+ * @public
4034 */
41-
4235export function getReactNativePersistence (
4336 storage : ReactNativeAsyncStorage
4437) : Persistence {
38+ // In the _getInstance() implementation (see src/core/persistence/index.ts),
39+ // we expect each "externs.Persistence" object passed to us by the user to
40+ // be able to be instantiated (as a class) using "new". That function also
41+ // expects the constructor to be empty. Since ReactNativeStorage requires the
42+ // underlying storage layer, we need to be able to create subclasses
43+ // (closures, esentially) that have the storage layer but empty constructor.
4544 return class implements PersistenceInternal {
4645 static type : 'LOCAL' = 'LOCAL' ;
4746 readonly type : PersistenceType = PersistenceType . LOCAL ;
0 commit comments