flurryx 1.2.1 → 1.3.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/README.md CHANGED
@@ -571,15 +571,15 @@ For data indexed by ID (user profiles, invoices, config entries), use `KeyedReso
571
571
 
572
572
  ```typescript
573
573
  interface KeyedResourceData<TKey extends string | number, TValue> {
574
- entities: Partial<Record<TKey, TValue>>;
575
- isLoading: Partial<Record<TKey, boolean>>;
576
- status: Partial<Record<TKey, ResourceStatus>>;
577
- errors: Partial<Record<TKey, ResourceErrors>>;
574
+ [key: string]: ResourceState<TValue> | undefined;
575
+ [key: number]: ResourceState<TValue> | undefined;
578
576
  }
579
577
  ```
580
578
 
581
579
  Each resource key gets **independent** loading, status, and error tracking. The top-level `ResourceState.isLoading` reflects whether _any_ key is loading.
582
580
 
581
+ On first keyed fetch, `syncToKeyedStore(..., id)` now bootstraps keyed slot immediately on subscribe. That means `data?.[id]?.isLoading` becomes `true` before first response arrives, without manually seeding `createKeyedResourceData()`.
582
+
583
583
  **Full example:**
584
584
 
585
585
  ```typescript
@@ -610,18 +610,18 @@ export class InvoiceFacade {
610
610
 
611
611
  // Component
612
612
  const data = this.facade.items().data; // KeyedResourceData
613
- const invoice = data?.entities["inv-123"]; // Invoice | undefined
614
- const loading = data?.isLoading["inv-123"]; // boolean | undefined
615
- const errors = data?.errors["inv-123"]; // ResourceErrors | undefined
613
+ const invoice = data?.["inv-123"]?.data; // Invoice | undefined
614
+ const loading = data?.["inv-123"]?.isLoading; // boolean | undefined
615
+ const errors = data?.["inv-123"]?.errors; // ResourceErrors | undefined
616
616
  ```
617
617
 
618
618
  **Utilities:**
619
619
 
620
620
  ```typescript
621
621
  import {
622
- createKeyedResourceData, // factory — returns empty { entities: {}, isLoading: {}, ... }
622
+ createKeyedResourceData, // factory — returns empty keyed object {}
623
623
  isKeyedResourceData, // type guard
624
- isAnyKeyLoading, // (loading: Record) => boolean
624
+ isAnyKeyLoading, // (data: KeyedResourceData) => boolean
625
625
  } from "flurryx";
626
626
  ```
627
627
 
@@ -979,10 +979,8 @@ export class SessionStore {
979
979
 
980
980
  // After loading customers "c1" and "c2", the cache contains:
981
981
  // {
982
- // entities: { c1: Customer, c2: Customer },
983
- // isLoading: { c1: false, c2: false },
984
- // status: { c1: 'Success', c2: 'Success' },
985
- // errors: {}
982
+ // c1: { data: Customer, isLoading: false, status: 'Success' },
983
+ // c2: { data: Customer, isLoading: false, status: 'Success' }
986
984
  // }
987
985
  }
988
986
  ```
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @flurryx/core\nexport type {\n ResourceState,\n StoreEnum,\n KeyedResourceData,\n KeyedResourceKey,\n ResourceStatus,\n ResourceErrors,\n} from \"@flurryx/core\";\nexport {\n isKeyedResourceData,\n createKeyedResourceData,\n isAnyKeyLoading,\n CACHE_NO_TIMEOUT,\n DEFAULT_CACHE_TTL_MS,\n} from \"@flurryx/core\";\n\n// @flurryx/store\nexport {\n BaseStore,\n LazyStore,\n Store,\n clearAllStores,\n mirrorKey,\n deriveKey,\n collectKeyed,\n cloneValue,\n createSnapshotRestorePatch,\n createInMemoryStoreMessageChannel,\n createStorageStoreMessageChannel,\n createLocalStorageStoreMessageChannel,\n createSessionStorageStoreMessageChannel,\n createCompositeStoreMessageChannel,\n} from \"@flurryx/store\";\nexport type {\n MirrorOptions,\n DeriveOptions,\n CollectKeyedOptions,\n StoreOptions,\n StoreDeadLetterEntry,\n StoreHistory,\n StoreHistoryEntry,\n StoreMessageStatus,\n StoreMessageRecord,\n StoreMessageChannel,\n StoreMessageChannelStorage,\n StoreMessageChannelOptions,\n CompositeStoreMessageChannelOptions,\n StorageStoreMessageChannelOptions,\n BrowserStorageStoreMessageChannelOptions,\n StoreSnapshot,\n StoreMessage,\n StoreDeadLetterCommand,\n StoreDeadLetterMeta,\n DeadLetterCommandResolverResult,\n UpdateStoreMessage,\n ClearStoreMessage,\n ClearAllStoreMessage,\n StartLoadingStoreMessage,\n StopLoadingStoreMessage,\n UpdateKeyedOneStoreMessage,\n ClearKeyedOneStoreMessage,\n StartKeyedLoadingStoreMessage,\n} from \"@flurryx/store\";\n\n// @flurryx/rx\nexport {\n syncToStore,\n syncToKeyedStore,\n SkipIfCached,\n Loading,\n defaultErrorNormalizer,\n} from \"@flurryx/rx\";\nexport type {\n SyncToStoreOptions,\n SyncToKeyedStoreOptions,\n ErrorNormalizer,\n} from \"@flurryx/rx\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,kBAMO;AAGP,mBAeO;AAiCP,gBAMO;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @flurryx/core\nexport type {\n ResourceState,\n StoreEnum,\n KeyedResourceData,\n KeyedResourceKey,\n ResourceStatus,\n ResourceErrors,\n} from \"@flurryx/core\";\nexport {\n isKeyedResourceData,\n createKeyedResourceData,\n isAnyKeyLoading,\n CACHE_NO_TIMEOUT,\n DEFAULT_CACHE_TTL_MS,\n} from \"@flurryx/core\";\n\n// @flurryx/store\nexport {\n BaseStore,\n LazyStore,\n Store,\n clearAllStores,\n mirrorKey,\n deriveKey,\n collectKeyed,\n cloneValue,\n createSnapshotRestorePatch,\n createInMemoryStoreMessageChannel,\n createStorageStoreMessageChannel,\n createLocalStorageStoreMessageChannel,\n createSessionStorageStoreMessageChannel,\n createCompositeStoreMessageChannel,\n} from \"@flurryx/store\";\nexport type {\n MirrorOptions,\n DeriveOptions,\n CollectKeyedOptions,\n StoreOptions,\n StoreDeadLetterEntry,\n StoreHistory,\n StoreHistoryEntry,\n StoreMessageStatus,\n StoreMessageRecord,\n StoreMessageChannel,\n StoreMessageChannelStorage,\n StoreMessageChannelOptions,\n CompositeStoreMessageChannelOptions,\n StorageStoreMessageChannelOptions,\n BrowserStorageStoreMessageChannelOptions,\n StoreSnapshot,\n StoreMessage,\n StoreDeadLetterCommand,\n StoreDeadLetterMeta,\n DeadLetterCommandResolverResult,\n UpdateStoreMessage,\n ClearStoreMessage,\n ClearAllStoreMessage,\n StartLoadingStoreMessage,\n StopLoadingStoreMessage,\n UpdateKeyedOneStoreMessage,\n ClearKeyedOneStoreMessage,\n StartKeyedLoadingStoreMessage,\n EnsureKeyedSlotStoreMessage,\n KeyedResourceState,\n KeyedStoreSignal,\n StoreSignal,\n ValueOrSignal,\n } from \"@flurryx/store\";\n\n// @flurryx/rx\nexport {\n syncToStore,\n syncToKeyedStore,\n SkipIfCached,\n Loading,\n defaultErrorNormalizer,\n} from \"@flurryx/rx\";\nexport type {\n SyncToStoreOptions,\n SyncToKeyedStoreOptions,\n ErrorNormalizer,\n} from \"@flurryx/rx\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,kBAMO;AAGP,mBAeO;AAsCP,gBAMO;","names":[]}
package/dist/index.d.cts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { CACHE_NO_TIMEOUT, DEFAULT_CACHE_TTL_MS, KeyedResourceData, KeyedResourceKey, ResourceErrors, ResourceState, ResourceStatus, StoreEnum, createKeyedResourceData, isAnyKeyLoading, isKeyedResourceData } from '@flurryx/core';
2
- export { BaseStore, BrowserStorageStoreMessageChannelOptions, ClearAllStoreMessage, ClearKeyedOneStoreMessage, ClearStoreMessage, CollectKeyedOptions, CompositeStoreMessageChannelOptions, DeadLetterCommandResolverResult, DeriveOptions, LazyStore, MirrorOptions, StartKeyedLoadingStoreMessage, StartLoadingStoreMessage, StopLoadingStoreMessage, StorageStoreMessageChannelOptions, Store, StoreDeadLetterCommand, StoreDeadLetterEntry, StoreDeadLetterMeta, StoreHistory, StoreHistoryEntry, StoreMessage, StoreMessageChannel, StoreMessageChannelOptions, StoreMessageChannelStorage, StoreMessageRecord, StoreMessageStatus, StoreOptions, StoreSnapshot, UpdateKeyedOneStoreMessage, UpdateStoreMessage, clearAllStores, cloneValue, collectKeyed, createCompositeStoreMessageChannel, createInMemoryStoreMessageChannel, createLocalStorageStoreMessageChannel, createSessionStorageStoreMessageChannel, createSnapshotRestorePatch, createStorageStoreMessageChannel, deriveKey, mirrorKey } from '@flurryx/store';
2
+ export { BaseStore, BrowserStorageStoreMessageChannelOptions, ClearAllStoreMessage, ClearKeyedOneStoreMessage, ClearStoreMessage, CollectKeyedOptions, CompositeStoreMessageChannelOptions, DeadLetterCommandResolverResult, DeriveOptions, EnsureKeyedSlotStoreMessage, KeyedResourceState, KeyedStoreSignal, LazyStore, MirrorOptions, StartKeyedLoadingStoreMessage, StartLoadingStoreMessage, StopLoadingStoreMessage, StorageStoreMessageChannelOptions, Store, StoreDeadLetterCommand, StoreDeadLetterEntry, StoreDeadLetterMeta, StoreHistory, StoreHistoryEntry, StoreMessage, StoreMessageChannel, StoreMessageChannelOptions, StoreMessageChannelStorage, StoreMessageRecord, StoreMessageStatus, StoreOptions, StoreSignal, StoreSnapshot, UpdateKeyedOneStoreMessage, UpdateStoreMessage, ValueOrSignal, clearAllStores, cloneValue, collectKeyed, createCompositeStoreMessageChannel, createInMemoryStoreMessageChannel, createLocalStorageStoreMessageChannel, createSessionStorageStoreMessageChannel, createSnapshotRestorePatch, createStorageStoreMessageChannel, deriveKey, mirrorKey } from '@flurryx/store';
3
3
  export { ErrorNormalizer, Loading, SkipIfCached, SyncToKeyedStoreOptions, SyncToStoreOptions, defaultErrorNormalizer, syncToKeyedStore, syncToStore } from '@flurryx/rx';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { CACHE_NO_TIMEOUT, DEFAULT_CACHE_TTL_MS, KeyedResourceData, KeyedResourceKey, ResourceErrors, ResourceState, ResourceStatus, StoreEnum, createKeyedResourceData, isAnyKeyLoading, isKeyedResourceData } from '@flurryx/core';
2
- export { BaseStore, BrowserStorageStoreMessageChannelOptions, ClearAllStoreMessage, ClearKeyedOneStoreMessage, ClearStoreMessage, CollectKeyedOptions, CompositeStoreMessageChannelOptions, DeadLetterCommandResolverResult, DeriveOptions, LazyStore, MirrorOptions, StartKeyedLoadingStoreMessage, StartLoadingStoreMessage, StopLoadingStoreMessage, StorageStoreMessageChannelOptions, Store, StoreDeadLetterCommand, StoreDeadLetterEntry, StoreDeadLetterMeta, StoreHistory, StoreHistoryEntry, StoreMessage, StoreMessageChannel, StoreMessageChannelOptions, StoreMessageChannelStorage, StoreMessageRecord, StoreMessageStatus, StoreOptions, StoreSnapshot, UpdateKeyedOneStoreMessage, UpdateStoreMessage, clearAllStores, cloneValue, collectKeyed, createCompositeStoreMessageChannel, createInMemoryStoreMessageChannel, createLocalStorageStoreMessageChannel, createSessionStorageStoreMessageChannel, createSnapshotRestorePatch, createStorageStoreMessageChannel, deriveKey, mirrorKey } from '@flurryx/store';
2
+ export { BaseStore, BrowserStorageStoreMessageChannelOptions, ClearAllStoreMessage, ClearKeyedOneStoreMessage, ClearStoreMessage, CollectKeyedOptions, CompositeStoreMessageChannelOptions, DeadLetterCommandResolverResult, DeriveOptions, EnsureKeyedSlotStoreMessage, KeyedResourceState, KeyedStoreSignal, LazyStore, MirrorOptions, StartKeyedLoadingStoreMessage, StartLoadingStoreMessage, StopLoadingStoreMessage, StorageStoreMessageChannelOptions, Store, StoreDeadLetterCommand, StoreDeadLetterEntry, StoreDeadLetterMeta, StoreHistory, StoreHistoryEntry, StoreMessage, StoreMessageChannel, StoreMessageChannelOptions, StoreMessageChannelStorage, StoreMessageRecord, StoreMessageStatus, StoreOptions, StoreSignal, StoreSnapshot, UpdateKeyedOneStoreMessage, UpdateStoreMessage, ValueOrSignal, clearAllStores, cloneValue, collectKeyed, createCompositeStoreMessageChannel, createInMemoryStoreMessageChannel, createLocalStorageStoreMessageChannel, createSessionStorageStoreMessageChannel, createSnapshotRestorePatch, createStorageStoreMessageChannel, deriveKey, mirrorKey } from '@flurryx/store';
3
3
  export { ErrorNormalizer, Loading, SkipIfCached, SyncToKeyedStoreOptions, SyncToStoreOptions, defaultErrorNormalizer, syncToKeyedStore, syncToStore } from '@flurryx/rx';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @flurryx/core\nexport type {\n ResourceState,\n StoreEnum,\n KeyedResourceData,\n KeyedResourceKey,\n ResourceStatus,\n ResourceErrors,\n} from \"@flurryx/core\";\nexport {\n isKeyedResourceData,\n createKeyedResourceData,\n isAnyKeyLoading,\n CACHE_NO_TIMEOUT,\n DEFAULT_CACHE_TTL_MS,\n} from \"@flurryx/core\";\n\n// @flurryx/store\nexport {\n BaseStore,\n LazyStore,\n Store,\n clearAllStores,\n mirrorKey,\n deriveKey,\n collectKeyed,\n cloneValue,\n createSnapshotRestorePatch,\n createInMemoryStoreMessageChannel,\n createStorageStoreMessageChannel,\n createLocalStorageStoreMessageChannel,\n createSessionStorageStoreMessageChannel,\n createCompositeStoreMessageChannel,\n} from \"@flurryx/store\";\nexport type {\n MirrorOptions,\n DeriveOptions,\n CollectKeyedOptions,\n StoreOptions,\n StoreDeadLetterEntry,\n StoreHistory,\n StoreHistoryEntry,\n StoreMessageStatus,\n StoreMessageRecord,\n StoreMessageChannel,\n StoreMessageChannelStorage,\n StoreMessageChannelOptions,\n CompositeStoreMessageChannelOptions,\n StorageStoreMessageChannelOptions,\n BrowserStorageStoreMessageChannelOptions,\n StoreSnapshot,\n StoreMessage,\n StoreDeadLetterCommand,\n StoreDeadLetterMeta,\n DeadLetterCommandResolverResult,\n UpdateStoreMessage,\n ClearStoreMessage,\n ClearAllStoreMessage,\n StartLoadingStoreMessage,\n StopLoadingStoreMessage,\n UpdateKeyedOneStoreMessage,\n ClearKeyedOneStoreMessage,\n StartKeyedLoadingStoreMessage,\n} from \"@flurryx/store\";\n\n// @flurryx/rx\nexport {\n syncToStore,\n syncToKeyedStore,\n SkipIfCached,\n Loading,\n defaultErrorNormalizer,\n} from \"@flurryx/rx\";\nexport type {\n SyncToStoreOptions,\n SyncToKeyedStoreOptions,\n ErrorNormalizer,\n} from \"@flurryx/rx\";\n"],"mappings":";AASA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAiCP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["// @flurryx/core\nexport type {\n ResourceState,\n StoreEnum,\n KeyedResourceData,\n KeyedResourceKey,\n ResourceStatus,\n ResourceErrors,\n} from \"@flurryx/core\";\nexport {\n isKeyedResourceData,\n createKeyedResourceData,\n isAnyKeyLoading,\n CACHE_NO_TIMEOUT,\n DEFAULT_CACHE_TTL_MS,\n} from \"@flurryx/core\";\n\n// @flurryx/store\nexport {\n BaseStore,\n LazyStore,\n Store,\n clearAllStores,\n mirrorKey,\n deriveKey,\n collectKeyed,\n cloneValue,\n createSnapshotRestorePatch,\n createInMemoryStoreMessageChannel,\n createStorageStoreMessageChannel,\n createLocalStorageStoreMessageChannel,\n createSessionStorageStoreMessageChannel,\n createCompositeStoreMessageChannel,\n} from \"@flurryx/store\";\nexport type {\n MirrorOptions,\n DeriveOptions,\n CollectKeyedOptions,\n StoreOptions,\n StoreDeadLetterEntry,\n StoreHistory,\n StoreHistoryEntry,\n StoreMessageStatus,\n StoreMessageRecord,\n StoreMessageChannel,\n StoreMessageChannelStorage,\n StoreMessageChannelOptions,\n CompositeStoreMessageChannelOptions,\n StorageStoreMessageChannelOptions,\n BrowserStorageStoreMessageChannelOptions,\n StoreSnapshot,\n StoreMessage,\n StoreDeadLetterCommand,\n StoreDeadLetterMeta,\n DeadLetterCommandResolverResult,\n UpdateStoreMessage,\n ClearStoreMessage,\n ClearAllStoreMessage,\n StartLoadingStoreMessage,\n StopLoadingStoreMessage,\n UpdateKeyedOneStoreMessage,\n ClearKeyedOneStoreMessage,\n StartKeyedLoadingStoreMessage,\n EnsureKeyedSlotStoreMessage,\n KeyedResourceState,\n KeyedStoreSignal,\n StoreSignal,\n ValueOrSignal,\n } from \"@flurryx/store\";\n\n// @flurryx/rx\nexport {\n syncToStore,\n syncToKeyedStore,\n SkipIfCached,\n Loading,\n defaultErrorNormalizer,\n} from \"@flurryx/rx\";\nexport type {\n SyncToStoreOptions,\n SyncToKeyedStoreOptions,\n ErrorNormalizer,\n} from \"@flurryx/rx\";\n"],"mappings":";AASA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAsCP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flurryx",
3
- "version": "1.2.1",
3
+ "version": "1.3.1",
4
4
  "description": "Signal-first reactive state management for Angular",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,9 +38,9 @@
38
38
  },
39
39
  "sideEffects": false,
40
40
  "dependencies": {
41
- "@flurryx/core": "1.1.0",
42
- "@flurryx/store": "1.2.1",
43
- "@flurryx/rx": "1.2.1"
41
+ "@flurryx/core": "1.3.1",
42
+ "@flurryx/store": "1.3.1",
43
+ "@flurryx/rx": "1.3.1"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "@angular/core": ">=17.0.0",