rooks
Version:
Essential React custom hooks ⚓ to super charge your components!
22 lines • 645 B
TypeScript
/**
* useMapState hook
* A hook to manage state in the form of a map or object.
*
* @param initialValue Initial value of the map
* @see https://react-hooks.org/docs/useMapState
*/
declare function useMapState<T extends {
[key: string]: unknown;
}, K extends keyof T>(initialValue: T): [
T,
{
has: (key: K) => boolean;
remove: (key: K) => void;
removeAll: () => void;
removeMultiple: (...keys: K[]) => void;
set: (key: K, value: T[K]) => void;
setMultiple: (next: Partial<T>) => void;
}
];
export { useMapState };
//# sourceMappingURL=useMapState.d.ts.map