@mmcodemark/fuselage-hooks
Version:
React hooks for Fuselage, Rocket.Chat's design system and UI toolkit
18 lines • 803 B
TypeScript
import type { Dispatch, SetStateAction } from 'react';
/**
* Hook to deal with localStorage
* @param key - the key associated to the value in the storage
* @param initialValue - the value returned when the key is not found at the storage
* @returns a state and a setter function
* @public
*/
export declare const useLocalStorage: <T>(key: string, initialValue: T) => [T, Dispatch<SetStateAction<T>>];
/**
* Hook to deal with sessionStorage
* @param key - the key associated to the value in the storage
* @param initialValue - the value returned when the key is not found at the storage
* @returns a state and a setter function
* @public
*/
export declare const useSessionStorage: <T>(key: string, initialValue: T) => [T, Dispatch<SetStateAction<T>>];
//# sourceMappingURL=useStorage.d.ts.map