UNPKG

@yoroi/common

Version:

The Common package of Yoroi SDK

17 lines 627 B
import React from 'react'; import { invalid } from '../../errors/errors'; import { mountAsyncStorage } from '../adapters/async-storage'; const AsyncStorageContext = /*#__PURE__*/React.createContext(undefined); export const AsyncStorageProvider = _ref => { let { children, storage = mountAsyncStorage({ path: '/' }) } = _ref; return /*#__PURE__*/React.createElement(AsyncStorageContext.Provider, { value: storage }, children); }; export const useAsyncStorage = () => React.useContext(AsyncStorageContext) ?? invalid('Missing AsyncStorageProvider'); //# sourceMappingURL=async-storage-reactjs.js.map