[Collectable.js] Immutable Set


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
23322Jul 28, 2021Oct 26, 2016Minified + gzip package size for @collectable/set in KB


Collectable.js: Immutable Set

Immutable Set

An persistent set data structure, backed by an immutable hash map

Build Status NPM version GitHub version

This documentation is under construction. The list of functions, descriptions and examples are pending.


# via NPM
npm install @collectable/set

# or Yarn
yarn add @collectable/set

If you intend to use other data structures as well, install the main collectable package instead. It takes a dependency on each of these data structures, and so they will become available implicitly, after installation.

# via NPM
npm install collectable

# or Yarn
yarn add collectable

TypeScript type definitions are built in.


Import and use the functions you need:

import { fromArray, toArray } from '@collectable/set';

const set = fromArray(['X', 'Y']); // => HashSet<[X, Y]>
const array = toArray(set); // => [X, Y]

Use a modern bundler such as Webpack 2 or Rollup in order to take advantage of tree shaking capabilities, giving you maximum flexibility to use what you need while excluding anything else from the final build.

Documentation pending

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.