@@ -26,22 +26,21 @@ import {
26
26
} from '../../core/persistence' ;
27
27
28
28
/**
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
40
34
*/
41
-
42
35
export function getReactNativePersistence (
43
36
storage : ReactNativeAsyncStorage
44
37
) : 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.
45
44
return class implements PersistenceInternal {
46
45
static type : 'LOCAL' = 'LOCAL' ;
47
46
readonly type : PersistenceType = PersistenceType . LOCAL ;
0 commit comments