Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solid-primitives/set

Package Overview
Dependencies
Maintainers
0
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/set

The Set & WeakSet data structures as a reactive signals.

  • 0.5.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Solid Primitives Set

@solid-primitives/set

turborepo size version stage

The Javascript built-in Set & WeakSet data structures as a reactive signals.

  • ReactiveSet - A reactive version of a Javascript built-in Set class.
  • ReactiveWeakSet - A reactive version of a Javascript built-in WeakSet class.

Installation

npm install @solid-primitives/set
# or
yarn add @solid-primitives/set
# or
pnpm add @solid-primitives/set

ReactiveSet

A reactive version of a Javascript built-in Set class.

How to use it

Import
import { ReactiveSet } from "@solid-primitives/set";
Basic usage
const set = new ReactiveSet([1, 1, 2, 3]);

// listen for changes reactively
createEffect(() => {
  [...set]; // => [1,2,3] (reactive on any change)
  set.has(2); // => true (reactive on change to the result)
});

// apply like with normal Set
set.add(4);
set.delete(2);
set.clear();

ReactiveWeakSet

A reactive version of a Javascript built-in WeakSet class.

How to use it

Import
import { ReactiveWeakSet } from "@solid-primitives/set";
Basic usage
const set = new ReactiveWeakSet([1, 1, 2, 3]);

// listen for changes reactively
createEffect(() => {
  set.has(2); // => true (reactive on change to the result)
});

// apply changes like with normal Set
set.add(4);
set.delete(2);

Changelog

See CHANGELOG.md

Keywords

FAQs

Package last updated on 29 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc