@streamscloud/kit 0.57.1 → 0.58.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.
@@ -4,11 +4,11 @@ export declare class KeyedCursorDataLoader<T> {
4
4
  private _loaded;
5
5
  private _pending;
6
6
  private _loadPage;
7
- private _loadAlongside;
7
+ private _loadWithFirstPage;
8
8
  constructor(init: {
9
9
  loadPage: (key: string, continuationToken: ContinuationToken) => Promise<CursorResult<T> | null>;
10
- /** Started with the key's first page and awaited by `ensureLoaded`; its outcome never reaches `isLoaded`. */
11
- loadAlongside?: (key: string) => Promise<void>;
10
+ /** Started with the key's first page — never with `loadMore` — and awaited by `ensureLoaded`; its outcome never reaches `isLoaded`. */
11
+ loadWithFirstPage?: (key: string) => Promise<void>;
12
12
  });
13
13
  items: (key?: string) => T[];
14
14
  loading: (key?: string) => boolean;
@@ -25,6 +25,6 @@ export declare class KeyedCursorDataLoader<T> {
25
25
  reload: (key?: string) => Promise<void>;
26
26
  private startLoad;
27
27
  private runLoad;
28
- private runAlongside;
28
+ private runSideLoad;
29
29
  private loaderFor;
30
30
  }
@@ -5,10 +5,10 @@ export class KeyedCursorDataLoader {
5
5
  _loaded = $state.raw({});
6
6
  _pending = {};
7
7
  _loadPage;
8
- _loadAlongside;
8
+ _loadWithFirstPage;
9
9
  constructor(init) {
10
10
  this._loadPage = init.loadPage;
11
- this._loadAlongside = init.loadAlongside;
11
+ this._loadWithFirstPage = init.loadWithFirstPage;
12
12
  }
13
13
  items = (key = '') => this.loaderFor(key).items;
14
14
  loading = (key = '') => this.loaderFor(key).loading;
@@ -46,17 +46,17 @@ export class KeyedCursorDataLoader {
46
46
  };
47
47
  runLoad = async (key) => {
48
48
  const loader = this.loaderFor(key);
49
- const alongside = this.runAlongside(key);
49
+ const sideLoad = this.runSideLoad(key);
50
50
  await loader.reset();
51
51
  this._loaded = { ...this._loaded, [key]: !loader.failed };
52
- await alongside;
52
+ await sideLoad;
53
53
  };
54
- runAlongside = async (key) => {
54
+ runSideLoad = async (key) => {
55
55
  try {
56
- await this._loadAlongside?.(key);
56
+ await this._loadWithFirstPage?.(key);
57
57
  }
58
58
  catch (error) {
59
- console.error('KeyedCursorDataLoader: failed to load alongside the page', error);
59
+ console.error('KeyedCursorDataLoader: failed to load with the first page', error);
60
60
  }
61
61
  };
62
62
  loaderFor = (key) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.57.1",
3
+ "version": "0.58.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",