import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import { browserStorageAdapter } from '../lib/storageAdapter';
const StorageAdapterContext = React.createContext(browserStorageAdapter);
export const StorageAdapterProvider = ({ adapter, children }) => {
    const value = React.useMemo(() => adapter ?? browserStorageAdapter, [adapter]);
    return _jsx(StorageAdapterContext.Provider, { value: value, children: children });
};
export const useStorageAdapter = () => {
    return React.useContext(StorageAdapterContext);
};
