UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

15 lines 666 B
export interface UseSetReturn<T> { set: Omit<Set<T>, 'add' | 'delete' | 'clear'>; add: (...items: T[]) => void; remove: (item: T) => void; clear: () => void; } /** * Hook for storing an ES6 set in React state. Methods that mutate the set have been hidden via TypeScript, * so if you adhere to the type definitions, the set is essentially immutable. * Modifications to the set should only be done via the functions returned by the hook, which will create a new object to trigger rerendering. * @param initialState * @returns */ export declare function useSet<T>(initialState?: T[] | Set<T>): UseSetReturn<T>; //# sourceMappingURL=useSet.d.ts.map