@pulse-js/svelte 0.1.4 → 0.1.6
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 +8 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -28,11 +28,11 @@ Wrap your sources with `usePulse` to get a writable/readable store.
|
|
|
28
28
|
import { usePulse } from '@pulse-js/svelte';
|
|
29
29
|
|
|
30
30
|
const count = source(0);
|
|
31
|
-
const
|
|
31
|
+
const countStore = usePulse(count);
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
|
-
<button on:click={() => count.
|
|
35
|
-
Count is {
|
|
34
|
+
<button on:click={() => count.update((n) => n + 1)}>
|
|
35
|
+
Count is {countStore.value}
|
|
36
36
|
</button>
|
|
37
37
|
```
|
|
38
38
|
|
|
@@ -46,12 +46,12 @@ Wrap guards with `useGuard` to get a readable store containing the status and re
|
|
|
46
46
|
import { useGuard } from '@pulse-js/svelte';
|
|
47
47
|
|
|
48
48
|
const isAdult = guard(() => age.value >= 18);
|
|
49
|
-
const
|
|
49
|
+
const isAdultStore = useGuard(isAdult);
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
|
-
{#if
|
|
53
|
-
<p>Result: {
|
|
54
|
-
{:else if
|
|
55
|
-
<p class="error">Error: {
|
|
52
|
+
{#if isAdultStore.status === 'ok'}
|
|
53
|
+
<p>Result: {isAdultStore.value}</p>
|
|
54
|
+
{:else if isAdultStore.status === 'fail'}
|
|
55
|
+
<p class="error">Error: {isAdultStore.reason}</p>
|
|
56
56
|
{/if}
|
|
57
57
|
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pulse-js/svelte",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.svelte.cjs",
|
|
6
6
|
"module": "dist/index.svelte.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"svelte": "^4.0.0 || ^5.0.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@pulse-js/core": "^0.2.
|
|
30
|
+
"@pulse-js/core": "^0.2.2"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"svelte": "^5.0.0",
|