solid-state-tools 1.1.2 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,16 +1,33 @@
1
- # Solid JS State Tools
1
+ # Solid State Tools
2
2
 
3
- This is a collection of simple utilities for managing [Solid JS](https://docs.solidjs.com/) state.
4
- It is intended to compliment Solid JS's existing state system, not replace it.
3
+ Links: [GitHub Repository](https://github.com/ReedSyllas/solid-state-tools), [NPM Package](https://www.npmjs.com/package/solid-state-tools).
5
4
 
6
- This package is tiny and only has a peer dependency of Solid JS.
5
+ Solid State Tools is a collection of simple utilities for managing [Solid JS](https://docs.solidjs.com/) state.
6
+
7
+ All features are intended to compliment Solid JS's existing state system, building upon the existing foundation.
8
+
9
+ The package is small and only has a peer dependency of Solid JS.
10
+
11
+ # Usage
12
+
13
+ This library introduces some new primitives:
14
+
15
+ 1. [atom](#atoms-atom)
16
+ 2. [createCouple](#couples-createcouple)
17
+
18
+ And, a few shorthand functions that combine these primitives and those from Solid JS together.
19
+
20
+ 1. [asig](#atomic-signals-asig)
21
+ 2. [apair](#atomic-couples-apair)
22
+
23
+ Read the sections below for a breakdown of each utility.
7
24
 
8
25
  ## Atoms (`atom`)
9
26
 
10
27
  Atoms combine the getter and setter of a [signal](https://docs.solidjs.com/concepts/signals) into one function.
11
28
 
12
29
  ```ts
13
- const count = atom(createSignal(0));
30
+ const count: Atom<Signal<number>> = atom(createSignal(0));
14
31
 
15
32
  console.log(count()); // 0
16
33
 
@@ -24,29 +41,52 @@ count((c) => c + 1);
24
41
  console.log(count()); // 102
25
42
  ```
26
43
 
27
- When called with no arguments, the atom acts like the signal's getter. If an argument is passed, it is forwarded to the signal's setter. Note that `undefined` _is_ considered an argument and is forwarded to the setter, as desired.
44
+ When called with no arguments, the atom acts like the signal's getter.
45
+ If an argument is passed, it is forwarded to the signal's setter. Note that `undefined` _is_ considered an argument and is forwarded to the setter.
28
46
 
29
- Atoms simplify the boilerplate that comes with managing getters and setters separately. However, signals are still preferred for granular control of the getter and setter. Additionally, atoms incur a tiny performance cost. Thus, atoms do not replace signals. They coexist.
47
+ Atoms simplify the boilerplate that comes with managing separate getters and setters.
48
+ However, signals are still preferred when granular control of the getter and setter is needed.
49
+ Additionally, atoms incur a tiny performance cost. Thus, atoms do not replace signals. They coexist.
30
50
 
31
51
  ## Atomic signals (`asig`)
32
52
 
33
- Because creating and wrapping a signal with `atom` is so common, a shorthand utility was created called `asig` (atomic signal).
53
+ Creating a signal and immediately 'atomizing' it is a common pattern. The `asig` function was created for this, along with its related type `Asig`.
34
54
 
35
55
  ```ts
36
- const count = asig(0);
37
- // is a shorthand for
38
- const count = atom(createSignal(0));
56
+ const count: Asig<number> = asig(0);
57
+ // is short for
58
+ const count: Atom<Signal<number>> = atom(createSignal(0));
39
59
  ```
40
60
 
41
- ## Co-signals (`createCouple`)
42
-
43
- A signal can be summarized as a getter setter pair. However, Solid JS's setters are more complex than just a function that accepts the new value. They can also accept a function which acts like a map predicate from the old value to the new one.
61
+ The second parameter (optional) is the config object, which is simply forwarded to the `createSignal` call.
44
62
 
45
63
  ```ts
46
- setCount(x => x + 1);
64
+ const list = asig([], { equals: false });
65
+ // is short for
66
+ const list = atom(createSignal([], { equals: false }));
47
67
  ```
48
68
 
49
- All of this is to say that creating signal pairs can be tedious because the setter has to handle this edge case. Take a look at the below example.
69
+ ## Couples (`createCouple`)
70
+
71
+ A signal can be summarized as a getter setter pair.
72
+ However, the setter of a Solid JS signal is more complex than it appears at first glance.
73
+ Why?
74
+
75
+ 1. It accepts a function which transforms the previous value into the new one.
76
+ ```ts
77
+ setCount(x => x + 1);
78
+ ```
79
+
80
+ 2. It also returns the value.
81
+ ```ts
82
+ const [ _count, setCount ] = createSignal(0);
83
+
84
+ console.log(setCount(10)); // Prints: 10
85
+ console.log(setCount(x => x + 5)); // Prints: 15
86
+ ```
87
+
88
+ All of this is to say that creating custom signal pairs can be tedious.
89
+ Below is an example showing the complexity involved.
50
90
 
51
91
  ```ts
52
92
  const [ count, setCount ] = createSignal(0);
@@ -56,40 +96,49 @@ const [ double, setDouble ] = [
56
96
  createMemo(() => count() * 2),
57
97
 
58
98
  // The setter
59
- (value: number | ((prev: number) => number)) => {
99
+ (newValue: number | ((prev: number) => number)) => {
60
100
 
61
- // Possibility of a function must be explicitly handled.
62
- const newValue = (typeof value === "function") ? value(double()) : value;
101
+ // The function case must be handled.
102
+ const unwrappedNewValue = (typeof newValue === "function") ? newValue(untrack(double)) : newValue;
63
103
 
64
- setCount(newValue / 2);
104
+ setCount(unwrappedNewValue / 2);
65
105
 
66
106
  // And the result must be returned.
67
- return newValue;
107
+ return unwrappedNewValue;
68
108
  },
69
109
  ];
110
+ ```
70
111
 
71
- // Both of the below work, as a signal should.
72
- setDouble(10); // double: 10, count: 5
73
- setDouble(x => x + 1); // double: 11, count: 5.5
112
+ With that, the following statements work (as is expected of a setter):
113
+
114
+ ```ts
115
+ setDouble(10); // double: 10, count: 5
116
+ setDouble(x => x + 1); // double: 11, count: 5.5
117
+ console.log(setDouble(20)); // Prints: 20
74
118
  ```
75
119
 
76
- Wouldn't it be convenient if we didn't have to handle all of that extra fluff though?
120
+ But, the crusty boilerplate to get it working is annoying as heck.
77
121
 
78
- Enter co-signals. `Cosignal` is a getter setter pair like `Signal`, except that the setter doesn't accept a mapping function nor return a value. The `createCouple` function accepts a co-signal as input.
122
+ **Enter the `createCouple` utility.**
123
+
124
+ It accepts a getter and a co-setter and returns a signal.
125
+ A co-setter is similar to a setter, except that it doesn't take a function nor does it return a value.
126
+ Basically, it's the previous example without the boilerplate.
127
+ See it in action:
79
128
 
80
129
  ```ts
81
130
  const [ count, setCount ] = createSignal(0);
82
131
 
83
- const [ double, setDouble ] = createCouple([
132
+ const [ double, setDouble ] = createCouple(
84
133
  () => count() * 2,
85
134
 
86
- (x) => {
87
- // Notice how we don't need to handle `x` being a function here.
88
- setCount(x / 2);
135
+ (newValue) => {
136
+ // Notice how we don't need to handle `newValue` being a function here.
137
+ setCount(newValue / 2);
89
138
 
90
- // Nor do we need to return the result.
139
+ // Nor do we need to return anything.
91
140
  },
92
- ]);
141
+ );
93
142
 
94
143
  // Yet, we can still pass a function in.
95
144
  setDouble(x => x + 2);
@@ -99,16 +148,31 @@ console.log(double(), count()); // 2 1
99
148
  console.log(setDouble(10), count()); // 10 5
100
149
  ```
101
150
 
102
- The `createCouple` function transforms a co-signal into a signal. In what way?
103
- 1. The getter is memoized for you.
104
- 2. The setter is wrapped so that if a function is passed in, it is evaluated with the current value and then forwarded to the cosignal's setter, returning the latest result.
151
+ Much better, right?
152
+
153
+ > [!NOTE]
154
+ > The getter passed to `createCouple` is always [memoized](https://docs.solidjs.com/concepts/derived-values/memos).
155
+ > This immediately invokes the getter, so keep that in mind.
105
156
 
106
- The signal returned by `createCouple` can also be wrapped with `atom` to combine the getter and setter into one.
157
+ By the way! A `createCouple` call, like any expression that evaluates to a signal, can be converted into an atom so that the getter and setter are merged into one.
107
158
 
108
159
  ```ts
109
160
  const double = atom(createCouple(/* ... */));
110
161
  ```
111
162
 
112
- ---
163
+ ## Atomic couples (`apair`)
164
+
165
+ Similar to [atomic signals](#atomic-signals-asig), wrapping a `createCouple` call with `atom` is a common enough pattern to warrant a shorthand: `apair`.
166
+
167
+ ```ts
168
+ const double = apair(() => count() * 2, (double) => count(double / 2));
169
+ // is short for
170
+ const double = atom(createCouple(() => count() * 2, (double) => count(double / 2)));
171
+ ```
172
+
173
+ # Conclusion
174
+
175
+ Perhaps you can see the power of the above primitives.
176
+ Not only in what they do, but also in how they combine.
113
177
 
114
- Perhaps you can see the power of the above primitives. Not only in what they can do on their own, but also in what they can do when combined.
178
+ More utilities for this library are in the works and will be coming soon.
package/dist/atom.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type Signal, type SignalOptions } from "solid-js";
1
+ import { type Accessor, type Signal, type SignalOptions } from "solid-js";
2
2
  /**
3
3
  * Any tuple of two functions where the first accepts no arguments and the second accepts any amount.
4
4
  */
@@ -32,7 +32,27 @@ export type Atom<T extends SignalLike = SignalLike> = T[0] & T[1];
32
32
  * count(count() + 1);
33
33
  * ```
34
34
  */
35
- export declare function atom<const T extends SignalLike>(value: T): Atom<T>;
35
+ export declare function atom<const T extends SignalLike>(signal: T): Atom<T>;
36
+ /**
37
+ * Similar to a signal setter, except it doesn't accept a mapping function nor return a result.
38
+ */
39
+ export type Cosetter<T> = (value: T) => void;
40
+ /**
41
+ * Create a signal from a cosignal.
42
+ *
43
+ * ### Example
44
+ * ```
45
+ * const [ count, setCount ] = createSignal(0);
46
+ * const [ double, setDouble ] = createSignalPair([
47
+ * () => count() * 2,
48
+ * (x) => void setCount(x / 2),
49
+ * ]);
50
+ *
51
+ * double(x => x + 2);
52
+ * console.log(double(), count()); // 2 1
53
+ * ```
54
+ */
55
+ export declare function createCouple<T>(getter: Accessor<T>, setter: Cosetter<T>): Signal<T>;
36
56
  /**
37
57
  * An atomic signal.
38
58
  * A signal where the getter and setter are combined into one function.
@@ -40,7 +60,7 @@ export declare function atom<const T extends SignalLike>(value: T): Atom<T>;
40
60
  export type Asig<T> = Atom<Signal<T>>;
41
61
  /**
42
62
  * Create an atomic signal.
43
- * Shorthand for `atom(createSignal(...))`.
63
+ * Short for `atom(createSignal(...))`.
44
64
  *
45
65
  * ### Example
46
66
  * ```
@@ -53,32 +73,23 @@ export type Asig<T> = Atom<Signal<T>>;
53
73
  * console.log(count()); // 20
54
74
  * ```
55
75
  */
56
- export declare function asig<T>(): Atom<Signal<T | undefined>>;
57
- export declare function asig<T>(value: T, options?: SignalOptions<T>): Atom<Signal<T>>;
58
- /**
59
- * A getter setter pair.
60
- * While similar to `Signal`, the setter of
61
- * `Cosignal` does not accept a mapping function;
62
- * nor does it return a result.
63
- */
64
- export type Cosignal<T> = [
65
- () => T,
66
- (value: T) => void
67
- ];
76
+ export declare function asig<T>(): Asig<T | undefined>;
77
+ export declare function asig<T>(value: T, options?: SignalOptions<T>): Asig<T>;
68
78
  /**
69
- * Create a signal from a cosignal.
79
+ * Create an atomic cosignal pair.
80
+ * Short for `atom(createCouple(...))`.
70
81
  *
71
82
  * ### Example
72
83
  * ```
73
- * const [ count, setCount ] = createSignal(0);
74
- * const [ double, setDouble ] = createSignalPair([
75
- * () => count() * 2,
76
- * (x) => void setCount(x / 2),
77
- * ]);
84
+ * const count = asig(0);
85
+ * const double = apair(() => count() * 2, (double) => void count(double / 2));
78
86
  *
79
- * double(x => x + 2);
80
- * console.log(double(), count()); // 2 1
87
+ * count(10);
88
+ * console.log(count(), double()); // 10 20
89
+ *
90
+ * double(100);
91
+ * console.log(count(), double()); // 50 100
81
92
  * ```
82
93
  */
83
- export declare function createCouple<T>(cosignal: Cosignal<T>): Signal<T>;
94
+ export declare function apair<T>(getter: Accessor<T>, setter: Cosetter<T>): Asig<T>;
84
95
  //# sourceMappingURL=atom.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"atom.d.ts","sourceRoot":"","sources":["../src/atom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAG3G;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,CAAE,MAAM,GAAG,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAE,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,UAAU,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAmBpE;;;GAGG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEt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CAAC;AAE7C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAmBnF;AAID;;;GAGG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;AAC/C,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;AAKvE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAE1E"}
package/dist/atom.js CHANGED
@@ -1,23 +1,42 @@
1
1
  import { createMemo, createSignal, untrack } from "solid-js";
2
2
  import { isDev } from "solid-js/web";
3
- export function atom(value) {
3
+ /**
4
+ * Combine a getter and setter function pair into one.
5
+ *
6
+ * Accepts a tuple of two functions.
7
+ * The first is the getter, the second is the setter.
8
+ * A new function is returned that, when called with zero arguments, calls the getter.
9
+ * Otherwise, it calls the setter and forwards all of the arguments.
10
+ *
11
+ * ### Example
12
+ * ```
13
+ * const count = atom(createSignal(0));
14
+ *
15
+ * // Read
16
+ * count();
17
+ *
18
+ * // Write
19
+ * count(100);
20
+ * count(x => x + 1);
21
+ * count(count() + 1);
22
+ * ```
23
+ */
24
+ export function atom(signal) {
4
25
  if (isDev) {
5
26
  // Assert that the input is valid.
6
27
  // For production, these checks are skipped for performance.
7
- if (!Array.isArray(value)) {
8
- throw new Error(`expected a getter setter pair as an array, but got ${typeof value}`);
28
+ if (!Array.isArray(signal)) {
29
+ throw new Error(`expected a getter setter pair as an array, but got ${typeof signal}`);
9
30
  }
10
- if (typeof value[0] !== "function") {
11
- throw new Error(`expected a getter function, but got ${typeof value[0]}`);
31
+ if (typeof signal[0] !== "function") {
32
+ throw new Error(`expected a getter function, but got ${typeof signal[0]}`);
12
33
  }
13
- if (typeof value[1] !== "function") {
14
- throw new Error(`expected a setter function, but got ${typeof value[1]}`);
34
+ if (typeof signal[1] !== "function") {
35
+ throw new Error(`expected a setter function, but got ${typeof signal[1]}`);
15
36
  }
16
37
  }
17
- return (...args) => (args.length === 0) ? value[0]() : value[1](...args);
18
- }
19
- export function asig(value, options) {
20
- return atom(createSignal(value, options));
38
+ const [getter, setter] = signal;
39
+ return (...args) => (args.length === 0) ? getter() : setter(...args);
21
40
  }
22
41
  /**
23
42
  * Create a signal from a cosignal.
@@ -34,25 +53,45 @@ export function asig(value, options) {
34
53
  * console.log(double(), count()); // 2 1
35
54
  * ```
36
55
  */
37
- export function createCouple(cosignal) {
56
+ export function createCouple(getter, setter) {
38
57
  if (isDev) {
39
58
  // Assert that the input is valid.
40
59
  // For production, these checks are skipped for performance.
41
- if (!Array.isArray(cosignal)) {
42
- throw new Error(`expected a getter setter pair as an array, but got ${typeof cosignal}`);
43
- }
44
- if (typeof cosignal[0] !== "function") {
45
- throw new Error(`expected a getter function, but got ${typeof cosignal[0]}`);
60
+ if (typeof getter !== "function") {
61
+ throw new Error(`expected getter to be a function, but got ${typeof getter}`);
46
62
  }
47
- if (typeof cosignal[1] !== "function") {
48
- throw new Error(`expected a setter function, but got ${typeof cosignal[1]}`);
63
+ if (typeof setter !== "function") {
64
+ throw new Error(`expected setter to be a function, but got ${typeof setter}`);
49
65
  }
50
66
  }
51
- const get = createMemo(cosignal[0]);
52
- const set = ((value) => {
53
- cosignal[1]((typeof value === "function") ? value(untrack(get)) : value);
54
- return untrack(get);
67
+ const get = createMemo(getter);
68
+ const set = ((source) => {
69
+ const value = (typeof source === "function") ? source(untrack(get)) : source;
70
+ setter(value);
71
+ return value;
55
72
  });
56
73
  return [get, set];
57
74
  }
75
+ export function asig(value, options) {
76
+ return atom(createSignal(value, options));
77
+ }
78
+ /**
79
+ * Create an atomic cosignal pair.
80
+ * Short for `atom(createCouple(...))`.
81
+ *
82
+ * ### Example
83
+ * ```
84
+ * const count = asig(0);
85
+ * const double = apair(() => count() * 2, (double) => void count(double / 2));
86
+ *
87
+ * count(10);
88
+ * console.log(count(), double()); // 10 20
89
+ *
90
+ * double(100);
91
+ * console.log(count(), double()); // 50 100
92
+ * ```
93
+ */
94
+ export function apair(getter, setter) {
95
+ return atom(createCouple(getter, setter));
96
+ }
58
97
  //# sourceMappingURL=atom.js.map
package/dist/atom.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"atom.js","sourceRoot":"","sources":["../src/atom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAgD,MAAM,UAAU,CAAC;AAC3G,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAsCrC,MAAM,UAAU,IAAI,CAAC,KAAc;IAClC,IAAI,KAAK,EAAE,CAAC;QACX,kCAAkC;QAClC,4DAA4D;QAE5D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,sDAAsD,OAAO,KAAK,EAAE,CAAC,CAAC;QACvF,CAAC;QACD,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,uCAAuC,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC;YACpC,MAAM,IAAI,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
1
  {
2
2
  "name": "solid-state-tools",
3
- "version": "1.1.2",
3
+ "version": "1.3.1",
4
4
  "description": "A collection of Solid JS state utilities",
5
5
  "author": "Reed Syllas <reedsyllas@gmail.com>",
6
6
  "license": "ISC",
@@ -10,6 +10,8 @@
10
10
  },
11
11
  "homepage": "https://github.com/ReedSyllas/solid-state-tools#readme",
12
12
  "keywords": [
13
+ "atom",
14
+ "signal",
13
15
  "solid",
14
16
  "state"
15
17
  ],