@wix/himalaya-cli 0.1648.0 → 0.1649.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.
- package/package.json +2 -2
- package/template-icons/wholesale-store.png +0 -0
- package/templates/wholesale-store/README.md +53 -0
- package/templates/wholesale-store/config.ts +247 -0
- package/templates/wholesale-store/dev/index.ts +12194 -0
- package/templates/wholesale-store/himalaya.content.json +43 -0
- package/templates/wholesale-store/himalaya.template.json +14 -0
- package/templates/wholesale-store/icon.png +0 -0
- package/templates/wholesale-store/platforms.json +1 -0
- package/templates/wholesale-store/tier5-src/_shared/app-locale.ts +61 -0
- package/templates/wholesale-store/tier5-src/_shared/branded-lite-hosted.ts +279 -0
- package/templates/wholesale-store/tier5-src/_shared/business-chat-copy.ts +40 -0
- package/templates/wholesale-store/tier5-src/_shared/business-chat-history.ts +51 -0
- package/templates/wholesale-store/tier5-src/_shared/business-chat-message-model.ts +177 -0
- package/templates/wholesale-store/tier5-src/_shared/business-chat-model.ts +56 -0
- package/templates/wholesale-store/tier5-src/_shared/business-chat-presenter.ts +576 -0
- package/templates/wholesale-store/tier5-src/_shared/business-chat-transport.ts +148 -0
- package/templates/wholesale-store/tier5-src/_shared/collection-contract.ts +228 -0
- package/templates/wholesale-store/tier5-src/_shared/collection-query-legacy.ts +194 -0
- package/templates/wholesale-store/tier5-src/_shared/collection-query.ts +252 -0
- package/templates/wholesale-store/tier5-src/_shared/collection-service.ts +423 -0
- package/templates/wholesale-store/tier5-src/_shared/detail-presence.ts +51 -0
- package/templates/wholesale-store/tier5-src/_shared/empty-flags.ts +33 -0
- package/templates/wholesale-store/tier5-src/_shared/engine-intl.ts +508 -0
- package/templates/wholesale-store/tier5-src/_shared/exclusive-writes.ts +66 -0
- package/templates/wholesale-store/tier5-src/_shared/himi-account.ts +164 -0
- package/templates/wholesale-store/tier5-src/_shared/himi-copy.ts +89 -0
- package/templates/wholesale-store/tier5-src/_shared/himi-store-categories.ts +108 -0
- package/templates/wholesale-store/tier5-src/_shared/himi-store-collection.ts +22 -0
- package/templates/wholesale-store/tier5-src/_shared/himi-store-saved.ts +57 -0
- package/templates/wholesale-store/tier5-src/_shared/himi-store.ts +7 -0
- package/templates/wholesale-store/tier5-src/_shared/himi-text.ts +24 -0
- package/templates/wholesale-store/tier5-src/_shared/hosted-checkout.ts +70 -0
- package/templates/wholesale-store/tier5-src/_shared/iap-presentation.ts +207 -0
- package/templates/wholesale-store/tier5-src/_shared/iap-worker.ts +125 -0
- package/templates/wholesale-store/tier5-src/_shared/inbox-rooms.ts +68 -0
- package/templates/wholesale-store/tier5-src/_shared/live-session.ts +172 -0
- package/templates/wholesale-store/tier5-src/_shared/local-preferences.ts +38 -0
- package/templates/wholesale-store/tier5-src/_shared/member-access.ts +52 -0
- package/templates/wholesale-store/tier5-src/_shared/member-account-routes.ts +52 -0
- package/templates/wholesale-store/tier5-src/_shared/member-orders.ts +8 -0
- package/templates/wholesale-store/tier5-src/_shared/member-screen.ts +99 -0
- package/templates/wholesale-store/tier5-src/_shared/online-actions.ts +76 -0
- package/templates/wholesale-store/tier5-src/_shared/owner-editor-value.ts +164 -0
- package/templates/wholesale-store/tier5-src/_shared/owner-load-error.ts +348 -0
- package/templates/wholesale-store/tier5-src/_shared/payment-setup.ts +6 -0
- package/templates/wholesale-store/tier5-src/_shared/read-service.ts +255 -0
- package/templates/wholesale-store/tier5-src/_shared/restaurant-ordering.ts +201 -0
- package/templates/wholesale-store/tier5-src/_shared/rich-body.ts +78 -0
- package/templates/wholesale-store/tier5-src/_shared/rich-content-link.ts +34 -0
- package/templates/wholesale-store/tier5-src/_shared/sign-in-sheet.ts +18 -0
- package/templates/wholesale-store/tier5-src/_shared/store-order-presentation.ts +56 -0
- package/templates/wholesale-store/tier5-src/_shared/store-product-info.ts +50 -0
- package/templates/wholesale-store/tier5-src/business-chat/index.ts +724 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-cart/index.ts +602 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-order/index.ts +472 -0
- package/templates/wholesale-store/tier5-src/himi-branded-lite-orders/index.ts +327 -0
- package/templates/wholesale-store/tier5-src/himi-store-account/index.ts +998 -0
- package/templates/wholesale-store/tier5-src/himi-store-product/index.ts +889 -0
- package/templates/wholesale-store/tier5-src/himi-store-saved/index.ts +68 -0
- package/templates/wholesale-store/tier5-src/himi-store-shop/index.ts +150 -0
- package/templates/wholesale-store/tier5-src/himi-wholesale-home/index.ts +507 -0
- package/templates/wholesale-store/tier5-src/wix-spaces-collection-detail/index.ts +195 -0
- package/templates/wholesale-store/tokens.json +340 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { createReadController, initialReadStatus, type ReadMetadata, type ReadStatus } from '@himalaya/state';
|
|
2
|
+
import { createLegacyCollectionQuery } from './collection-query-legacy';
|
|
3
|
+
|
|
4
|
+
/** Backend collection lifecycle shared by domain workers. The domain supplies
|
|
5
|
+
* the query and row mapper; this layer never calls a domain API or mutates it. */
|
|
6
|
+
export interface CollectionQuery {
|
|
7
|
+
query: string;
|
|
8
|
+
filter: string;
|
|
9
|
+
sort: 'default' | 'az' | 'za';
|
|
10
|
+
savedIds: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface CollectionPage<Row> {
|
|
13
|
+
items: Row[];
|
|
14
|
+
nextCursor: string;
|
|
15
|
+
total?: number;
|
|
16
|
+
metadata?: Record<string, unknown>;
|
|
17
|
+
complete?: boolean;
|
|
18
|
+
provenance?: ReadMetadata;
|
|
19
|
+
/** A result derived entirely from local criteria/authored configuration (e.g. no saved IDs). */
|
|
20
|
+
local?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface CollectionQueryState<Row> extends CollectionPage<Row> {
|
|
23
|
+
criteria: CollectionQuery;
|
|
24
|
+
status: 'idle' | 'loading' | 'ready' | 'error';
|
|
25
|
+
loadingMore: boolean;
|
|
26
|
+
pageError: boolean;
|
|
27
|
+
complete: boolean;
|
|
28
|
+
error: string;
|
|
29
|
+
read: ReadStatus;
|
|
30
|
+
/** The rows are the source's `cached` page, shown while the live read is still out. */
|
|
31
|
+
provisional?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** What a collection showed, as `shownPage` hands it out and `seed` takes it back on a restored boot. */
|
|
34
|
+
export interface CollectionShownPage<Row> {
|
|
35
|
+
state: CollectionQueryState<Row>;
|
|
36
|
+
loadedPages: number;
|
|
37
|
+
}
|
|
38
|
+
export interface CollectionQuerySource<Row> {
|
|
39
|
+
fetch(criteria: CollectionQuery, cursor: string, options?: CollectionReadOptions): Promise<CollectionPage<Row>>;
|
|
40
|
+
/** Source forwards cache mode and metadata to every SDK read. */
|
|
41
|
+
cacheRead?: boolean;
|
|
42
|
+
/** Optional public cache for immediate paint; always incomplete, never a paging authority. */
|
|
43
|
+
cached?(criteria: CollectionQuery): Promise<CollectionPage<Row> | undefined>;
|
|
44
|
+
id(row: Row): string;
|
|
45
|
+
errorMessage?(error: unknown): string;
|
|
46
|
+
/** Private collections must discard prior rows when access or identity changes. A revalidation keeps the
|
|
47
|
+
* rows it shows through any other failure: safe because one worker never serves two identities (its pool
|
|
48
|
+
* key carries the account, and a purge tears parked workers down). */
|
|
49
|
+
clearOnError?(error: unknown): boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface CollectionReadOptions {
|
|
52
|
+
cache: 'only-if-cached' | 'reload';
|
|
53
|
+
onCacheResult(metadata: ReadMetadata): void;
|
|
54
|
+
}
|
|
55
|
+
const normalize = (q: Partial<CollectionQuery>): CollectionQuery => ({
|
|
56
|
+
query: typeof q.query === 'string' ? q.query.trim().slice(0, 256) : '',
|
|
57
|
+
filter: typeof q.filter === 'string' ? q.filter.slice(0, 256) : 'all',
|
|
58
|
+
sort: q.sort === 'az' || q.sort === 'za' ? q.sort : 'default',
|
|
59
|
+
savedIds: Array.isArray(q.savedIds) ? [...new Set(q.savedIds.filter(id => typeof id === 'string' && id.length > 0 && id.length <= 256))].slice(0, 500) : [],
|
|
60
|
+
});
|
|
61
|
+
const copyQuery = (q: CollectionQuery): CollectionQuery => ({ ...q, savedIds: [...q.savedIds] });
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/** Refreshes stage a complete replacement at the currently loaded depth. Old rows
|
|
65
|
+
* and cursors remain usable until every replacement page succeeds. Query changes
|
|
66
|
+
* start a separate snapshot; they never reuse a subset from another query. */
|
|
67
|
+
export function createCollectionQuery<Row>(source: CollectionQuerySource<Row>, publish: (state: CollectionQueryState<Row>) => void) {
|
|
68
|
+
// Only opted-in reads use the new snapshot/recovery controller. Other template collections
|
|
69
|
+
// keep their established query, pagination, and warm-return behavior.
|
|
70
|
+
if (!source.cacheRead) return createLegacyCollectionQuery(source, publish);
|
|
71
|
+
const sample = (globalThis as { himalaya?: { input?: Record<string, unknown> } }).himalaya?.input?.__himiOwnerPreview === 'sample';
|
|
72
|
+
const cacheRead = source.cacheRead && !sample;
|
|
73
|
+
const shouldClearOnError = (error: unknown) => source.clearOnError?.(error) === true
|
|
74
|
+
|| /HTTP 40[13]\b|forbidden|principal.changed|identity.changed/i.test(String(error));
|
|
75
|
+
let generation = 0, disposed = false, loadedPages = 1, wantedPages = 1, restoringPages = 1, key = '';
|
|
76
|
+
let pending: Promise<void> | undefined;
|
|
77
|
+
let suppressPublish = false;
|
|
78
|
+
let state: CollectionQueryState<Row> = { criteria: normalize({}), items: [], nextCursor: '', status: 'idle',
|
|
79
|
+
loadingMore: false, pageError: false, complete: false, error: '', read: initialReadStatus() };
|
|
80
|
+
let lastShown: CollectionShownPage<Row> | undefined;
|
|
81
|
+
const sameCriteria = (a: CollectionQuery, b: CollectionQuery) => JSON.stringify(a) === JSON.stringify(b);
|
|
82
|
+
const snapshot = (): CollectionQueryState<Row> => ({ ...state, read: { ...state.read }, criteria: copyQuery(state.criteria), items: [...state.items] });
|
|
83
|
+
const emit = () => {
|
|
84
|
+
if (disposed) return;
|
|
85
|
+
// A settled answer replaces it, an empty one included: rows the live query proved gone are never kept.
|
|
86
|
+
if (state.status === 'ready' && !state.pageError && !state.loadingMore && !state.provisional) {
|
|
87
|
+
lastShown = { state: snapshot(), loadedPages };
|
|
88
|
+
}
|
|
89
|
+
if (suppressPublish) return;
|
|
90
|
+
publish(snapshot());
|
|
91
|
+
};
|
|
92
|
+
const merge = (old: Row[], page: Row[]): Row[] => {
|
|
93
|
+
const positions = new Map<string, number>(), result: Row[] = [];
|
|
94
|
+
for (const item of [...old, ...page]) {
|
|
95
|
+
const id = source.id(item);
|
|
96
|
+
if (!id) throw new Error('A backend collection row requires an identity');
|
|
97
|
+
const index = positions.get(id);
|
|
98
|
+
if (index === undefined) { positions.set(id, result.length); result.push(item); }
|
|
99
|
+
else result[index] = item;
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
};
|
|
103
|
+
const combine = (a: ReadMetadata, b: ReadMetadata): ReadMetadata => ({
|
|
104
|
+
source: a.source === 'cache' || b.source === 'cache' ? 'cache' : 'network',
|
|
105
|
+
fetchedAt: Math.min(a.fetchedAt, b.fetchedAt), cacheable: a.cacheable && b.cacheable,
|
|
106
|
+
expiresAt: Math.min(a.expiresAt ?? 0, b.expiresAt ?? 0),
|
|
107
|
+
});
|
|
108
|
+
const readPage = async (criteria: CollectionQuery, cursor: string, cache: 'only-if-cached' | 'reload') => {
|
|
109
|
+
let provenance: ReadMetadata | undefined;
|
|
110
|
+
const page = await source.fetch(criteria, cursor, { cache, onCacheResult(value) { provenance = provenance ? combine(provenance, value) : value; } });
|
|
111
|
+
if (!Array.isArray(page.items) || typeof page.nextCursor !== 'string' || (cursor && page.nextCursor === cursor))
|
|
112
|
+
throw new Error('Invalid collection page');
|
|
113
|
+
if (page.local === true) provenance = { source: 'local', fetchedAt: 0, cacheable: false };
|
|
114
|
+
if (cacheRead && !provenance && !page.provenance) throw new Error('Read source did not provide response provenance');
|
|
115
|
+
// A legacy/error fallback is never a successful server refresh.
|
|
116
|
+
if (page.metadata?.fromCache && !provenance) throw new Error('Cache response has no policy provenance');
|
|
117
|
+
return { ...page, items: merge([], page.items), provenance: provenance ?? page.provenance ??
|
|
118
|
+
{ source: 'network' as const, fetchedAt: Date.now(), cacheable: false } };
|
|
119
|
+
};
|
|
120
|
+
const reader = createReadController<CollectionPage<Row>>({
|
|
121
|
+
allowLocal: true,
|
|
122
|
+
...(sample ? { online: () => true } : {}),
|
|
123
|
+
...(!sample && (source.cached || cacheRead) ? { cached: async (readKey: string) => {
|
|
124
|
+
const criteria = JSON.parse(readKey) as CollectionQuery;
|
|
125
|
+
const page = cacheRead ? await readPage(criteria, '', 'only-if-cached') : await source.cached?.(criteria);
|
|
126
|
+
if (!page?.provenance || !['cache', 'local'].includes(page.provenance.source)) return undefined;
|
|
127
|
+
return { data: { ...page, nextCursor: '', complete: !page.nextCursor }, metadata: page.provenance };
|
|
128
|
+
} } : {}),
|
|
129
|
+
fetch: async (readKey) => {
|
|
130
|
+
const criteria = JSON.parse(readKey) as CollectionQuery, revision = generation, depth = wantedPages;
|
|
131
|
+
let page = await readPage(criteria, '', 'reload'), count = 1;
|
|
132
|
+
const seen = new Set<string>();
|
|
133
|
+
while (page.nextCursor && count < depth) {
|
|
134
|
+
if (disposed || revision !== generation) throw new Error('Read disposed');
|
|
135
|
+
if (seen.has(page.nextCursor)) throw new Error('Repeated collection cursor');
|
|
136
|
+
seen.add(page.nextCursor);
|
|
137
|
+
const next = await readPage(criteria, page.nextCursor, 'reload');
|
|
138
|
+
if (next.provenance.source !== 'network') throw new Error('Refresh returned cached data');
|
|
139
|
+
page = { ...page, items: merge(page.items, next.items), nextCursor: next.nextCursor, complete: next.complete, provenance: combine(page.provenance, next.provenance) };
|
|
140
|
+
count++;
|
|
141
|
+
}
|
|
142
|
+
if (!disposed && revision === generation) loadedPages = count;
|
|
143
|
+
return { data: page, metadata: page.provenance };
|
|
144
|
+
},
|
|
145
|
+
clearOnError: error => {
|
|
146
|
+
const clear = shouldClearOnError(error);
|
|
147
|
+
if (clear) lastShown = undefined;
|
|
148
|
+
return clear;
|
|
149
|
+
},
|
|
150
|
+
errorMessage: source.errorMessage,
|
|
151
|
+
publish: (page, read) => {
|
|
152
|
+
state = { ...state, ...(page ?? { items: [], nextCursor: '', total: undefined, metadata: undefined }),
|
|
153
|
+
metadata: page ? { ...page.metadata, fromCache: read.fromCache } : undefined,
|
|
154
|
+
read, status: read.hasSnapshot ? 'ready' : read.refreshing ? 'loading' : 'error',
|
|
155
|
+
complete: !!page && (page.complete ?? !page.nextCursor), loadingMore: false, pageError: false,
|
|
156
|
+
provisional: read.fromCache && read.refreshing,
|
|
157
|
+
error: read.offline && !read.hasSnapshot ? "This content isn’t available offline. Connect to load it." : read.error };
|
|
158
|
+
emit();
|
|
159
|
+
},
|
|
160
|
+
});
|
|
161
|
+
const query = (criteria: Partial<CollectionQuery>, restorePages = false, _revalidate = false): Promise<void> => {
|
|
162
|
+
if (disposed) return Promise.resolve();
|
|
163
|
+
const next = normalize(criteria), nextKey = JSON.stringify(next);
|
|
164
|
+
if (key === nextKey && pending) return pending;
|
|
165
|
+
const same = key === nextKey;
|
|
166
|
+
if (!same) { loadedPages = 1; restoringPages = 1; }
|
|
167
|
+
key = nextKey; generation++; wantedPages = same ? Math.max(1, loadedPages, restorePages ? restoringPages : 1) : 1;
|
|
168
|
+
state = { ...state, criteria: next };
|
|
169
|
+
const revision = generation;
|
|
170
|
+
pending = reader.load(key).finally(() => { if (revision === generation) pending = undefined; });
|
|
171
|
+
return pending;
|
|
172
|
+
};
|
|
173
|
+
const loadMore = async () => {
|
|
174
|
+
if (disposed || pending || state.loadingMore || !state.nextCursor) return;
|
|
175
|
+
const revision = generation, criteria = copyQuery(state.criteria), cursor = state.nextCursor;
|
|
176
|
+
state = { ...state, loadingMore: true, pageError: false }; emit();
|
|
177
|
+
try {
|
|
178
|
+
const page = await readPage(criteria, cursor, 'reload');
|
|
179
|
+
if (disposed || revision !== generation) return;
|
|
180
|
+
if (page.provenance.source !== 'network') throw new Error('Page returned cached data');
|
|
181
|
+
const provenance = state.provenance ? combine(state.provenance, page.provenance) : page.provenance;
|
|
182
|
+
state = { ...state, ...page, provenance, items: merge(state.items, page.items), total: page.total ?? state.total,
|
|
183
|
+
metadata: page.metadata ?? state.metadata, loadingMore: false, pageError: false, complete: page.complete ?? !page.nextCursor };
|
|
184
|
+
loadedPages++;
|
|
185
|
+
wantedPages = loadedPages;
|
|
186
|
+
// Keep the read controller's retained snapshot aligned with appended pages.
|
|
187
|
+
reader.replace({ data: state, metadata: provenance });
|
|
188
|
+
} catch (error) {
|
|
189
|
+
if (disposed || revision !== generation) return;
|
|
190
|
+
if (shouldClearOnError(error)) {
|
|
191
|
+
loadedPages = 1; wantedPages = 1; lastShown = undefined; reader.invalidate();
|
|
192
|
+
const message = source.errorMessage?.(error) || 'This content is unavailable for this account. Try signing in again.';
|
|
193
|
+
state = { ...state, status: 'error', loadingMore: false, pageError: false,
|
|
194
|
+
error: message, read: { ...state.read, error: message } };
|
|
195
|
+
emit();
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
state = { ...state, loadingMore: false, pageError: true, complete: false,
|
|
199
|
+
error: source.errorMessage?.(error) || 'The next page could not load. Try again.' };
|
|
200
|
+
emit();
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
// A late page must not repopulate a cleared/private snapshot after logout or disconnect.
|
|
204
|
+
const host = (globalThis as { himalaya?: { __subscribeReadLifecycle?(listener: (signal: string) => void): () => void } }).himalaya;
|
|
205
|
+
const stop = host?.__subscribeReadLifecycle?.(signal => {
|
|
206
|
+
if (signal === 'invalidate' || signal === 'offline' || signal === 'dispose') {
|
|
207
|
+
generation++; pending = undefined;
|
|
208
|
+
if (signal !== 'offline') { loadedPages = 1; wantedPages = 1; lastShown = undefined; }
|
|
209
|
+
if (signal === 'dispose') disposed = true;
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
return {
|
|
213
|
+
getState: snapshot,
|
|
214
|
+
query: (criteria: Partial<CollectionQuery>, restorePages = false, revalidate = false) => {
|
|
215
|
+
restoringPages = restorePages ? Math.max(1, loadedPages) : 1;
|
|
216
|
+
return query(criteria, restorePages, revalidate);
|
|
217
|
+
},
|
|
218
|
+
shownPage(): CollectionShownPage<Row> | undefined {
|
|
219
|
+
if (!lastShown || !sameCriteria(lastShown.state.criteria, state.criteria)) return undefined;
|
|
220
|
+
return { state: { ...lastShown.state, read: { ...lastShown.state.read }, criteria: copyQuery(lastShown.state.criteria), items: [...lastShown.state.items] }, loadedPages: lastShown.loadedPages };
|
|
221
|
+
},
|
|
222
|
+
/** A cold boot restored from disk: what the last run showed becomes what this one shows, so its first `load`
|
|
223
|
+
* revalidates behind it instead of starting empty. Only before the first query, and only a well-formed page; an
|
|
224
|
+
* empty one is the list's empty state. */
|
|
225
|
+
seed(page: unknown): boolean {
|
|
226
|
+
const candidate = page && typeof page === 'object' ? page as Partial<CollectionShownPage<Row>> : undefined;
|
|
227
|
+
const restored = candidate?.state;
|
|
228
|
+
const provenance = restored?.provenance;
|
|
229
|
+
if (generation !== 0 || state.status !== 'idle' || !restored || restored.status !== 'ready'
|
|
230
|
+
|| !Array.isArray(restored.items) || typeof restored.nextCursor !== 'string'
|
|
231
|
+
|| !provenance || !['cache', 'network'].includes(provenance.source) || !provenance.cacheable
|
|
232
|
+
|| provenance.expiresAt === undefined || provenance.expiresAt <= Date.now()) return false;
|
|
233
|
+
try { restored.items.forEach(item => { if (!source.id(item)) throw new Error('A backend collection row requires an identity'); }); } catch { return false; }
|
|
234
|
+
state = { ...state, ...restored, criteria: normalize(restored.criteria ?? {}), items: [...restored.items], status: 'ready',
|
|
235
|
+
loadingMore: false, pageError: false, provisional: false, error: '' };
|
|
236
|
+
loadedPages = Math.max(1, Math.floor(Number(candidate?.loadedPages) || 1));
|
|
237
|
+
wantedPages = loadedPages;
|
|
238
|
+
const saved = state.provenance;
|
|
239
|
+
if (!saved) return false;
|
|
240
|
+
suppressPublish = true;
|
|
241
|
+
key = JSON.stringify(state.criteria);
|
|
242
|
+
reader.replace({ data: state, metadata: saved }, key);
|
|
243
|
+
suppressPublish = false;
|
|
244
|
+
lastShown = { state: snapshot(), loadedPages };
|
|
245
|
+
return true;
|
|
246
|
+
},
|
|
247
|
+
refresh: () => query(state.criteria, true, true),
|
|
248
|
+
loadMore,
|
|
249
|
+
retry: () => state.pageError ? loadMore() : query(state.criteria, true, true),
|
|
250
|
+
dispose() { disposed = true; generation++; stop?.(); reader.dispose(); },
|
|
251
|
+
};
|
|
252
|
+
}
|