UNPKG

@lens-protocol/react-native

Version:
35 lines (32 loc) 970 B
import { a as _createClass, _ as _classCallCheck } from '../../../dist/createClass-8c76aa5f.esm.js'; import { MMKV } from 'react-native-mmkv'; var MmkvStorageProvider = /*#__PURE__*/function () { function MmkvStorageProvider() { _classCallCheck(this, MmkvStorageProvider); this.storage = new MMKV({ id: 'lens-sdk-storage' }); } _createClass(MmkvStorageProvider, [{ key: "getItem", value: function getItem(key) { var _this$storage$getStri; return (_this$storage$getStri = this.storage.getString(key)) !== null && _this$storage$getStri !== void 0 ? _this$storage$getStri : null; } }, { key: "setItem", value: function setItem(key, value) { this.storage.set(key, value); } }, { key: "removeItem", value: function removeItem(key) { this.storage["delete"](key); } }]); return MmkvStorageProvider; }(); function storage() { return new MmkvStorageProvider(); } export { storage };