@livestore/svelte 0.4.0-dev.26 → 0.4.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store.svelte.d.ts","sourceRoot":"","sources":["../src/create-store.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAG9B,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"create-store.svelte.d.ts","sourceRoot":"","sources":["../src/create-store.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAG9B,KAAK,eAAe,EAEpB,KAAK,KAAK,EACX,MAAM,sBAAsB,CAAA;AAM7B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,WAAW,GAAU,OAAO,SAAS,eAAe,EAC/D,SAAS,yBAAyB,CAAC,OAAO,CAAC,KAC1C,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAqDxB,CAAA"}
|
|
@@ -43,7 +43,8 @@ export const createStore = async (options) => {
|
|
|
43
43
|
const updates = new SvelteSet();
|
|
44
44
|
const originalQuery = store.query;
|
|
45
45
|
// monkey-patch `store.query` to add some ✨ svelte magic ✨
|
|
46
|
-
store.query = (
|
|
46
|
+
store.query = ((...args) => {
|
|
47
|
+
const [queryDef, options] = args;
|
|
47
48
|
// TODO support other query types
|
|
48
49
|
if (isLiveQueryDef(queryDef) === true && queryDef._tag === 'def' && $effect.tracking() === true) {
|
|
49
50
|
const token = {};
|
|
@@ -67,7 +68,7 @@ export const createStore = async (options) => {
|
|
|
67
68
|
}
|
|
68
69
|
// Fallback to the original query implementation
|
|
69
70
|
return originalQuery(queryDef, options);
|
|
70
|
-
};
|
|
71
|
+
});
|
|
71
72
|
return store;
|
|
72
73
|
};
|
|
73
74
|
//# sourceMappingURL=create-store.svelte.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store.svelte.js","sourceRoot":"","sources":["../src/create-store.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,cAAc,
|
|
1
|
+
{"version":3,"file":"create-store.svelte.js","sourceRoot":"","sources":["../src/create-store.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,cAAc,GAIf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAC9B,OAA2C,EAClB,EAAE;IAC3B,6DAA6D;IAC7D,wDAAwD;IACxD,IAAI,MAA+B,CAAA;IACnC,IAAI,CAAC;QACH,MAAM,GAAG,cAAc,EAAE,CAAA;IAC3B,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IAEV,MAAM,KAAK,GAAG,MAAM,kBAAkB,CAAU;QAC9C,GAAG,OAAO;QACV,GAAG,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;KAC9B,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,IAAI,SAAS,EAAM,CAAA;IAEnC,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAA;IAEjC,0DAA0D;IAC1D,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAsC,EAAE,EAAE;QAC3D,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;QAEhC,iCAAiC;QACjC,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAK,IAAI,IAAI,QAAQ,CAAC,IAAI,KAAK,KAAK,IAAI,OAAO,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC;YAChG,MAAM,KAAK,GAAG,EAAE,CAAA;YAEhB,4EAA4E;YAC5E,uDAAuD;YACvD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAElB,IAAI,OAAO,GAAG,IAAI,CAAA;YAElB,OAAO,CAAC,GAAG,EAAE;gBACX,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,GAAG,EAAE;oBACjD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;wBACrB,OAAO,GAAG,KAAK,CAAA;wBACf,OAAM;oBACR,CAAC;oBAED,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;gBACpB,CAAC,CAAC,CAAA;gBAEF,OAAO,GAAG,EAAE;oBACV,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;oBACrB,WAAW,EAAE,CAAA;gBACf,CAAC,CAAA;YACH,CAAC,CAAC,CAAA;QACJ,CAAC;QAED,gDAAgD;QAChD,OAAO,aAAa,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACzC,CAAC,CAAyB,CAAA;IAE1B,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/svelte",
|
|
3
|
-
"version": "0.4.0
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"svelte"
|
|
6
6
|
],
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@opentelemetry/api": "1.9.0",
|
|
27
|
-
"@livestore/common": "^0.4.0
|
|
28
|
-
"@livestore/livestore": "^0.4.0
|
|
29
|
-
"@livestore/utils": "^0.4.0
|
|
27
|
+
"@livestore/common": "^0.4.0",
|
|
28
|
+
"@livestore/livestore": "^0.4.0",
|
|
29
|
+
"@livestore/utils": "^0.4.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@sveltejs/vite-plugin-svelte": "6.2.1",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"typescript": "5.9.3",
|
|
38
38
|
"vite": "7.3.1",
|
|
39
39
|
"vitest": "3.2.4",
|
|
40
|
-
"@livestore/adapter-web": "^0.4.0
|
|
41
|
-
"@livestore/utils-dev": "^0.4.0
|
|
40
|
+
"@livestore/adapter-web": "^0.4.0",
|
|
41
|
+
"@livestore/utils-dev": "^0.4.0"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@effect/ai": "^0.35.0",
|
|
@@ -4,9 +4,7 @@ import {
|
|
|
4
4
|
createStorePromise,
|
|
5
5
|
isLiveQueryDef,
|
|
6
6
|
type LiveStoreSchema,
|
|
7
|
-
type Queryable,
|
|
8
7
|
type RefreshReason,
|
|
9
|
-
type Schema,
|
|
10
8
|
type Store,
|
|
11
9
|
} from '@livestore/livestore'
|
|
12
10
|
import { omitUndefineds } from '@livestore/utils'
|
|
@@ -60,10 +58,9 @@ export const createStore = async <TSchema extends LiveStoreSchema>(
|
|
|
60
58
|
const originalQuery = store.query
|
|
61
59
|
|
|
62
60
|
// monkey-patch `store.query` to add some ✨ svelte magic ✨
|
|
63
|
-
store.query = <
|
|
64
|
-
queryDef
|
|
65
|
-
|
|
66
|
-
): TResult => {
|
|
61
|
+
store.query = ((...args: Parameters<typeof originalQuery>) => {
|
|
62
|
+
const [queryDef, options] = args
|
|
63
|
+
|
|
67
64
|
// TODO support other query types
|
|
68
65
|
if (isLiveQueryDef(queryDef) === true && queryDef._tag === 'def' && $effect.tracking() === true) {
|
|
69
66
|
const token = {}
|
|
@@ -93,7 +90,7 @@ export const createStore = async <TSchema extends LiveStoreSchema>(
|
|
|
93
90
|
|
|
94
91
|
// Fallback to the original query implementation
|
|
95
92
|
return originalQuery(queryDef, options)
|
|
96
|
-
}
|
|
93
|
+
}) as typeof originalQuery
|
|
97
94
|
|
|
98
95
|
return store
|
|
99
96
|
}
|