import type { Dispatch, SetStateAction } from 'react'; import { useStorage } from './useStorage.ts'; import type { UseStorageOptions } from './useStorage.ts'; /** Custom hook that uses session storage to persist state across page reloads */ export function useSessionStorage( key: string, initialValue: (() => T) | T, options: UseStorageOptions = {} ): [T, Dispatch>] { return useStorage(key, initialValue, 'sessionStorage', options); }