@yoroi/common
Version:
The Common package of Yoroi SDK
20 lines (19 loc) • 663 B
JavaScript
;
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