UNPKG

@yoroi/common

Version:

The Common package of Yoroi SDK

17 lines 617 B
import React from 'react'; import { invalid } from '../../errors/errors'; import { mountMMKVStorage } from '../adapters/mmkv-storage'; const SyncStorageContext = /*#__PURE__*/React.createContext(undefined); export const SyncStorageProvider = _ref => { let { children, storage = mountMMKVStorage({ path: '/' }) } = _ref; return /*#__PURE__*/React.createElement(SyncStorageContext.Provider, { value: storage }, children); }; export const useSyncStorage = () => React.useContext(SyncStorageContext) ?? invalid('Missing SyncStorageProvider'); //# sourceMappingURL=sync-storage-reactjs.js.map