mobx-bonsai
Version:
A fast lightweight alternative to MobX-State-Tree + Y.js two-way binding
14 lines (13 loc) • 454 B
TypeScript
/**
* Returns a Set-like view of the given array.
*
* For plain arrays, the set interface is backed by the array,
* ensuring values appear only once. For observable arrays, mutations
* are wrapped in actions using MobX.
*
* @template T The type of the values.
* @param data An array to be wrapped as a Set.
* @returns A Set-like view over the array.
* @throws When data is not an array.
*/
export declare function asSet<T>(data: T[]): Set<T>;