0.7.1 • Published 8 months ago
@solid-primitives/set v0.7.1
@solid-primitives/set
The Javascript built-in Set & WeakSet data structures as a reactive signals.
ReactiveSet- A reactive version of a Javascript built-inSetclass.ReactiveWeakSet- A reactive version of a Javascript built-inWeakSetclass.
Installation
npm install @solid-primitives/set
# or
yarn add @solid-primitives/set
# or
pnpm add @solid-primitives/setReactiveSet
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
0.7.1
8 months ago
0.7.0
8 months ago
0.6.0
11 months ago
0.5.0
1 year ago
0.4.12
1 year ago
0.4.11
2 years ago
0.4.10
2 years ago
0.4.9
2 years ago
0.4.8
2 years ago
0.4.7
2 years ago
0.4.5
3 years ago
0.4.4
3 years ago
0.4.6
3 years ago
0.4.2-beta.0
3 years ago
0.4.1
3 years ago
0.4.0
3 years ago
0.4.3
3 years ago
0.4.2
3 years ago
0.3.2
3 years ago
0.3.1
3 years ago
0.3.0
3 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.1.0
4 years ago
0.0.100
4 years ago