UNPKG

@yoroi/common

Version:
20 lines (19 loc) 663 B
"use strict"; import React from 'react'; import { invalid } from '../../errors/errors'; import { mountAsyncStorage } from '../adapters/async-storage'; import { jsx as _jsx } from "react/jsx-runtime"; const AsyncStorageContext = /*#__PURE__*/React.createContext(undefined); export const AsyncStorageProvider = ({ children, storage = mountAsyncStorage({ path: '/' }) }) => { return /*#__PURE__*/_jsx(AsyncStorageContext.Provider, { value: storage, children: children }); }; export const useAsyncStorage = () => React.useContext(AsyncStorageContext) ?? invalid('Missing AsyncStorageProvider'); //# sourceMappingURL=async-storage-reactjs.js.map