@flurryx/store 1.0.0 → 1.0.1
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/dist/index.cjs +273 -78
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -3
- package/dist/index.d.ts +33 -3
- package/dist/index.js +255 -60
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -306,6 +306,14 @@ interface IStore<TData extends StoreDataShape<TData>> {
|
|
|
306
306
|
* @returns A cleanup function that removes the listener.
|
|
307
307
|
*/
|
|
308
308
|
onUpdate<K extends StoreKey<TData>>(key: K, callback: (state: TData[K], previousState: TData[K]) => void): () => void;
|
|
309
|
+
/** Reactive signal containing the full history entries. */
|
|
310
|
+
readonly history: Signal<readonly StoreHistoryEntry<TData>[]>;
|
|
311
|
+
/** Reactive signal containing all channel message records. */
|
|
312
|
+
readonly messages: Signal<readonly StoreMessageRecord<TData>[]>;
|
|
313
|
+
/** Reactive signal containing the current history index. */
|
|
314
|
+
readonly currentIndex: Signal<number>;
|
|
315
|
+
/** Reactive signal containing all registered store keys. */
|
|
316
|
+
readonly keys: Signal<readonly StoreKey<TData>[]>;
|
|
309
317
|
}
|
|
310
318
|
|
|
311
319
|
/**
|
|
@@ -449,6 +457,12 @@ interface StoreHistory<TData extends StoreDataShape<TData>, TKey extends StoreKe
|
|
|
449
457
|
replayDeadLetters(): number;
|
|
450
458
|
/** Returns the currently restored history index used by snapshot navigation. */
|
|
451
459
|
getCurrentIndex(): number;
|
|
460
|
+
/** Reactive signal containing the full history entries. */
|
|
461
|
+
readonly historySignal: Signal<readonly StoreHistoryEntry<TData, TKey>[]>;
|
|
462
|
+
/** Reactive signal containing all channel message records. */
|
|
463
|
+
readonly messagesSignal: Signal<readonly StoreMessageRecord<TData, TKey>[]>;
|
|
464
|
+
/** Reactive signal containing the current history index. */
|
|
465
|
+
readonly currentIndexSignal: Signal<number>;
|
|
452
466
|
}
|
|
453
467
|
|
|
454
468
|
/**
|
|
@@ -469,7 +483,7 @@ declare abstract class BaseStore<TEnum extends Record<string, string | number>,
|
|
|
469
483
|
protected readonly storeEnum: TEnum;
|
|
470
484
|
private readonly signalsState;
|
|
471
485
|
private readonly storeKeys;
|
|
472
|
-
private readonly
|
|
486
|
+
private readonly historyDriver;
|
|
473
487
|
/** @inheritDoc */
|
|
474
488
|
readonly travelTo: (index: number) => void;
|
|
475
489
|
/** @inheritDoc */
|
|
@@ -485,6 +499,14 @@ declare abstract class BaseStore<TEnum extends Record<string, string | number>,
|
|
|
485
499
|
/** @inheritDoc */
|
|
486
500
|
readonly getCurrentIndex: () => number;
|
|
487
501
|
/** @inheritDoc */
|
|
502
|
+
readonly history: Signal<readonly StoreHistoryEntry<TData>[]>;
|
|
503
|
+
/** @inheritDoc */
|
|
504
|
+
readonly messages: Signal<readonly StoreMessageRecord<TData>[]>;
|
|
505
|
+
/** @inheritDoc */
|
|
506
|
+
readonly currentIndex: Signal<number>;
|
|
507
|
+
/** @inheritDoc */
|
|
508
|
+
readonly keys: Signal<readonly StoreKey<TData>[]>;
|
|
509
|
+
/** @inheritDoc */
|
|
488
510
|
replay(id: number): number;
|
|
489
511
|
/** @inheritDoc */
|
|
490
512
|
replay(ids: readonly number[]): number;
|
|
@@ -580,7 +602,7 @@ declare abstract class BaseStore<TEnum extends Record<string, string | number>,
|
|
|
580
602
|
declare class LazyStore<TData extends StoreDataShape<TData>> implements IStore<TData> {
|
|
581
603
|
private readonly signals;
|
|
582
604
|
private readonly hooks;
|
|
583
|
-
private readonly
|
|
605
|
+
private readonly historyDriver;
|
|
584
606
|
/** @inheritDoc */
|
|
585
607
|
readonly travelTo: (index: number) => void;
|
|
586
608
|
/** @inheritDoc */
|
|
@@ -591,7 +613,6 @@ declare class LazyStore<TData extends StoreDataShape<TData>> implements IStore<T
|
|
|
591
613
|
getMessages(): readonly StoreMessageRecord<TData>[];
|
|
592
614
|
/** @inheritDoc */
|
|
593
615
|
getMessages<K extends StoreKey<TData>>(key: K): readonly StoreMessageRecord<TData, K>[];
|
|
594
|
-
/** @inheritDoc */
|
|
595
616
|
readonly getDeadLetters: () => readonly StoreDeadLetterEntry<TData, StoreKey<TData>>[];
|
|
596
617
|
/** @inheritDoc */
|
|
597
618
|
readonly replayDeadLetter: (id: number) => boolean;
|
|
@@ -600,6 +621,15 @@ declare class LazyStore<TData extends StoreDataShape<TData>> implements IStore<T
|
|
|
600
621
|
/** @inheritDoc */
|
|
601
622
|
readonly getCurrentIndex: () => number;
|
|
602
623
|
/** @inheritDoc */
|
|
624
|
+
readonly history: Signal<readonly StoreHistoryEntry<TData>[]>;
|
|
625
|
+
/** @inheritDoc */
|
|
626
|
+
readonly messages: Signal<readonly StoreMessageRecord<TData>[]>;
|
|
627
|
+
/** @inheritDoc */
|
|
628
|
+
readonly currentIndex: Signal<number>;
|
|
629
|
+
/** @inheritDoc */
|
|
630
|
+
readonly keys: Signal<readonly StoreKey<TData>[]>;
|
|
631
|
+
private readonly keysSignal;
|
|
632
|
+
/** @inheritDoc */
|
|
603
633
|
replay(id: number): number;
|
|
604
634
|
/** @inheritDoc */
|
|
605
635
|
replay(ids: readonly number[]): number;
|
package/dist/index.d.ts
CHANGED
|
@@ -306,6 +306,14 @@ interface IStore<TData extends StoreDataShape<TData>> {
|
|
|
306
306
|
* @returns A cleanup function that removes the listener.
|
|
307
307
|
*/
|
|
308
308
|
onUpdate<K extends StoreKey<TData>>(key: K, callback: (state: TData[K], previousState: TData[K]) => void): () => void;
|
|
309
|
+
/** Reactive signal containing the full history entries. */
|
|
310
|
+
readonly history: Signal<readonly StoreHistoryEntry<TData>[]>;
|
|
311
|
+
/** Reactive signal containing all channel message records. */
|
|
312
|
+
readonly messages: Signal<readonly StoreMessageRecord<TData>[]>;
|
|
313
|
+
/** Reactive signal containing the current history index. */
|
|
314
|
+
readonly currentIndex: Signal<number>;
|
|
315
|
+
/** Reactive signal containing all registered store keys. */
|
|
316
|
+
readonly keys: Signal<readonly StoreKey<TData>[]>;
|
|
309
317
|
}
|
|
310
318
|
|
|
311
319
|
/**
|
|
@@ -449,6 +457,12 @@ interface StoreHistory<TData extends StoreDataShape<TData>, TKey extends StoreKe
|
|
|
449
457
|
replayDeadLetters(): number;
|
|
450
458
|
/** Returns the currently restored history index used by snapshot navigation. */
|
|
451
459
|
getCurrentIndex(): number;
|
|
460
|
+
/** Reactive signal containing the full history entries. */
|
|
461
|
+
readonly historySignal: Signal<readonly StoreHistoryEntry<TData, TKey>[]>;
|
|
462
|
+
/** Reactive signal containing all channel message records. */
|
|
463
|
+
readonly messagesSignal: Signal<readonly StoreMessageRecord<TData, TKey>[]>;
|
|
464
|
+
/** Reactive signal containing the current history index. */
|
|
465
|
+
readonly currentIndexSignal: Signal<number>;
|
|
452
466
|
}
|
|
453
467
|
|
|
454
468
|
/**
|
|
@@ -469,7 +483,7 @@ declare abstract class BaseStore<TEnum extends Record<string, string | number>,
|
|
|
469
483
|
protected readonly storeEnum: TEnum;
|
|
470
484
|
private readonly signalsState;
|
|
471
485
|
private readonly storeKeys;
|
|
472
|
-
private readonly
|
|
486
|
+
private readonly historyDriver;
|
|
473
487
|
/** @inheritDoc */
|
|
474
488
|
readonly travelTo: (index: number) => void;
|
|
475
489
|
/** @inheritDoc */
|
|
@@ -485,6 +499,14 @@ declare abstract class BaseStore<TEnum extends Record<string, string | number>,
|
|
|
485
499
|
/** @inheritDoc */
|
|
486
500
|
readonly getCurrentIndex: () => number;
|
|
487
501
|
/** @inheritDoc */
|
|
502
|
+
readonly history: Signal<readonly StoreHistoryEntry<TData>[]>;
|
|
503
|
+
/** @inheritDoc */
|
|
504
|
+
readonly messages: Signal<readonly StoreMessageRecord<TData>[]>;
|
|
505
|
+
/** @inheritDoc */
|
|
506
|
+
readonly currentIndex: Signal<number>;
|
|
507
|
+
/** @inheritDoc */
|
|
508
|
+
readonly keys: Signal<readonly StoreKey<TData>[]>;
|
|
509
|
+
/** @inheritDoc */
|
|
488
510
|
replay(id: number): number;
|
|
489
511
|
/** @inheritDoc */
|
|
490
512
|
replay(ids: readonly number[]): number;
|
|
@@ -580,7 +602,7 @@ declare abstract class BaseStore<TEnum extends Record<string, string | number>,
|
|
|
580
602
|
declare class LazyStore<TData extends StoreDataShape<TData>> implements IStore<TData> {
|
|
581
603
|
private readonly signals;
|
|
582
604
|
private readonly hooks;
|
|
583
|
-
private readonly
|
|
605
|
+
private readonly historyDriver;
|
|
584
606
|
/** @inheritDoc */
|
|
585
607
|
readonly travelTo: (index: number) => void;
|
|
586
608
|
/** @inheritDoc */
|
|
@@ -591,7 +613,6 @@ declare class LazyStore<TData extends StoreDataShape<TData>> implements IStore<T
|
|
|
591
613
|
getMessages(): readonly StoreMessageRecord<TData>[];
|
|
592
614
|
/** @inheritDoc */
|
|
593
615
|
getMessages<K extends StoreKey<TData>>(key: K): readonly StoreMessageRecord<TData, K>[];
|
|
594
|
-
/** @inheritDoc */
|
|
595
616
|
readonly getDeadLetters: () => readonly StoreDeadLetterEntry<TData, StoreKey<TData>>[];
|
|
596
617
|
/** @inheritDoc */
|
|
597
618
|
readonly replayDeadLetter: (id: number) => boolean;
|
|
@@ -600,6 +621,15 @@ declare class LazyStore<TData extends StoreDataShape<TData>> implements IStore<T
|
|
|
600
621
|
/** @inheritDoc */
|
|
601
622
|
readonly getCurrentIndex: () => number;
|
|
602
623
|
/** @inheritDoc */
|
|
624
|
+
readonly history: Signal<readonly StoreHistoryEntry<TData>[]>;
|
|
625
|
+
/** @inheritDoc */
|
|
626
|
+
readonly messages: Signal<readonly StoreMessageRecord<TData>[]>;
|
|
627
|
+
/** @inheritDoc */
|
|
628
|
+
readonly currentIndex: Signal<number>;
|
|
629
|
+
/** @inheritDoc */
|
|
630
|
+
readonly keys: Signal<readonly StoreKey<TData>[]>;
|
|
631
|
+
private readonly keysSignal;
|
|
632
|
+
/** @inheritDoc */
|
|
603
633
|
replay(id: number): number;
|
|
604
634
|
/** @inheritDoc */
|
|
605
635
|
replay(ids: readonly number[]): number;
|