solid-state-tools 1.0.3 → 1.0.4
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 +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,11 +51,11 @@ const [ double, setDouble ] = createCosignal([
|
|
|
51
51
|
]);
|
|
52
52
|
|
|
53
53
|
// Yet, we can still pass a mapping function here.
|
|
54
|
-
|
|
54
|
+
setDouble(x => x + 2);
|
|
55
55
|
console.log(double(), count()); // 12 6
|
|
56
56
|
|
|
57
57
|
// Or simply use it traditionally.
|
|
58
|
-
|
|
58
|
+
setDouble(10);
|
|
59
59
|
console.log(double(), count()); // 10 5
|
|
60
60
|
```
|
|
61
61
|
|
|
@@ -69,10 +69,10 @@ const [ double, setDouble ] = createCosignal([
|
|
|
69
69
|
]);
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
Finally, co-signals can be wrapped with `atom
|
|
72
|
+
Finally, co-signals can be wrapped with `atom` to combine their getter and setter.
|
|
73
73
|
|
|
74
74
|
```ts
|
|
75
75
|
const double = atom(createCosignal(/* ... */));
|
|
76
76
|
```
|
|
77
77
|
|
|
78
|
-
To be clear, `createCosignal` and `createSignal` return the same kind of value and therefore should work in every situation native signals do.
|
|
78
|
+
To be clear, `createCosignal` and `createSignal` return the same kind of value (`Signal`) and therefore should work in every situation native signals do.
|