@react-native-async-storage/async-storage
Version:
Asynchronous, persistent, key-value storage system for React Native.
29 lines (23 loc) • 1.28 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _reactNative = require("react-native");
var _shouldFallbackToLegacyNativeModule = require("./shouldFallbackToLegacyNativeModule");
// @ts-ignore Module '"react-native"' has no exported member 'TurboModuleRegistry'.
let RCTAsyncStorage = _reactNative.NativeModules['PlatformLocalStorage'] || // Support for external modules, like react-native-windows
_reactNative.NativeModules['RNC_AsyncSQLiteDBStorage'] || _reactNative.NativeModules['RNCAsyncStorage'];
if (!RCTAsyncStorage && (0, _shouldFallbackToLegacyNativeModule.shouldFallbackToLegacyNativeModule)()) {
// TurboModuleRegistry falls back to NativeModules so we don't have to try go
// assign NativeModules' counterparts if TurboModuleRegistry would resolve
// with undefined.
if (_reactNative.TurboModuleRegistry) {
RCTAsyncStorage = _reactNative.TurboModuleRegistry.get('AsyncSQLiteDBStorage') || _reactNative.TurboModuleRegistry.get('AsyncLocalStorage');
} else {
RCTAsyncStorage = _reactNative.NativeModules['AsyncSQLiteDBStorage'] || _reactNative.NativeModules['AsyncLocalStorage'];
}
}
var _default = RCTAsyncStorage;
exports.default = _default;
//# sourceMappingURL=RCTAsyncStorage.js.map
;