one
Version:
One is a React framework for web, iOS, and Android apps.
32 lines (29 loc) • 1.01 kB
JavaScript
import { NitroModules } from "react-native-nitro-modules";
import { rethrowNativeError } from "../nativeError.native.js";
var hybrid;
function native() {
hybrid !== null && hybrid !== void 0 ? hybrid : hybrid = NitroModules.createHybridObject("OneProtectedStore");
return hybrid;
}
function createItem(key, value, policy) {
return native().createItem(key, value, policy).catch(rethrowNativeError);
}
function getItem(key, reason, policy) {
return native().getItem(key, reason, policy).then(function(value) {
return value !== null && value !== void 0 ? value : null;
}, rethrowNativeError);
}
function updateItem(key, value, reason, policy) {
return native().updateItem(key, value, reason, policy).catch(rethrowNativeError);
}
function deleteItem(key, reason, policy) {
return native().deleteItem(key, reason, policy).catch(rethrowNativeError);
}
var ProtectedStore = Object.freeze({
createItem,
getItem,
updateItem,
deleteItem
});
export { ProtectedStore };
//# sourceMappingURL=index.native.js.map