teamplay 0.4.0-alpha.21 → 0.4.0-alpha.22
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/orm/Compat/hooksCompat.js +12 -2
- package/package.json +2 -2
|
@@ -97,7 +97,8 @@ export function useBatchDoc (collection, id, options) {
|
|
|
97
97
|
|
|
98
98
|
export function useBatchDoc$ (collection, id, _options) {
|
|
99
99
|
const $doc = getDocSignal(collection, id, 'useBatchDoc')
|
|
100
|
-
|
|
100
|
+
const options = _options ? { ..._options, ...BATCH_SUB_OPTIONS } : BATCH_SUB_OPTIONS
|
|
101
|
+
return useSub($doc, undefined, options)
|
|
101
102
|
}
|
|
102
103
|
|
|
103
104
|
export function useAsyncDoc$ (collection, id, options) {
|
|
@@ -140,7 +141,8 @@ export function useAsyncQuery (collection, query, options) {
|
|
|
140
141
|
|
|
141
142
|
export function useBatchQuery$ (collection, query, _options) {
|
|
142
143
|
const $collection = getCollectionSignal(collection, query, 'useBatchQuery')
|
|
143
|
-
|
|
144
|
+
const options = _options ? { ..._options, ...BATCH_SUB_OPTIONS } : BATCH_SUB_OPTIONS
|
|
145
|
+
return useSub($collection, normalizeQuery(query, 'useBatchQuery'), options)
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
export function useBatchQuery (collection, query, options) {
|
|
@@ -306,3 +308,11 @@ function normalizeQuery (query, hookName) {
|
|
|
306
308
|
}
|
|
307
309
|
return query
|
|
308
310
|
}
|
|
311
|
+
|
|
312
|
+
const BATCH_SUB_OPTIONS = Object.freeze({
|
|
313
|
+
async: false,
|
|
314
|
+
batch: true,
|
|
315
|
+
// Batch hooks are a hard suspense barrier. Deferred params can skip the barrier
|
|
316
|
+
// on route transitions and cause immediate reads from stale/empty local nodes.
|
|
317
|
+
defer: false
|
|
318
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teamplay",
|
|
3
|
-
"version": "0.4.0-alpha.
|
|
3
|
+
"version": "0.4.0-alpha.22",
|
|
4
4
|
"description": "Full-stack signals ORM with multiplayer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
]
|
|
82
82
|
},
|
|
83
83
|
"license": "MIT",
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "c66a5b5dbfe9d2ff95f9531c31b0794d2b647ce7"
|
|
85
85
|
}
|