|
@@ -34,16 +34,7 @@ export default class Storage {
|
34
|
34
|
// Load all previously persisted data items from React Native's
|
35
|
35
|
// AsyncStorage.
|
36
|
36
|
|
37
|
|
- /**
|
38
|
|
- * A flag to indicate that the async {@code AsyncStorage} is not
|
39
|
|
- * initialized yet. This is native specific but it will work
|
40
|
|
- * fine on web as well, as it will have no value (== false) there.
|
41
|
|
- * This is required to be available as we need a sync way to check
|
42
|
|
- * if the storage is inited or not.
|
43
|
|
- */
|
44
|
|
- this._initializing = true;
|
45
|
|
-
|
46
|
|
- this._inited = new Promise(resolve => {
|
|
37
|
+ this._initialized = new Promise(resolve => {
|
47
|
38
|
AsyncStorage.getAllKeys().then((...getAllKeysCallbackArgs) => {
|
48
|
39
|
// XXX The keys argument of getAllKeys' callback may
|
49
|
40
|
// or may not be preceded by an error argument.
|
|
@@ -77,7 +68,6 @@ export default class Storage {
|
77
|
68
|
}
|
78
|
69
|
}
|
79
|
70
|
|
80
|
|
- this._initializing = false;
|
81
|
71
|
resolve();
|
82
|
72
|
});
|
83
|
73
|
});
|