@@ -297,13 +297,22 @@ import {
297297 _HAS ,
298298} from '../common/strings.ts' ;
299299import {
300- Offsets ,
301300 useProvideThing ,
302301 useThing ,
303302 useThingIds ,
304303 useThingOrThingById ,
305304 useThings ,
306305} from './context.ts' ;
306+ import {
307+ OFFSET_CHECKPOINTS ,
308+ OFFSET_INDEXES ,
309+ OFFSET_METRICS ,
310+ OFFSET_PERSISTER ,
311+ OFFSET_QUERIES ,
312+ OFFSET_RELATIONSHIPS ,
313+ OFFSET_STORE ,
314+ OFFSET_SYNCHRONIZER ,
315+ } from './Provider.tsx' ;
307316
308317const EMPTY_ARRAY : Readonly < [ ] > = [ ] ;
309318
@@ -525,22 +534,22 @@ export const useCreateStore: typeof useCreateStoreDecl = (
525534) : Store => useMemo ( create , createDeps ) ;
526535
527536export const useStoreIds : typeof useStoreIdsDecl = ( ) =>
528- useThingIds ( Offsets . Store ) ;
537+ useThingIds ( OFFSET_STORE ) ;
529538
530539export const useStore : typeof useStoreDecl = ( id ?: Id ) : Store | undefined =>
531- useThing ( id , Offsets . Store ) ;
540+ useThing ( id , OFFSET_STORE ) ;
532541
533542export const useStores : typeof useStoresDecl = ( ) : IdObj < Store > =>
534- useThings ( Offsets . Store ) ;
543+ useThings ( OFFSET_STORE ) ;
535544
536545export const useStoreOrStoreById : typeof useStoreOrStoreByIdDecl = (
537546 storeOrStoreId ?: StoreOrStoreId ,
538- ) : Store | undefined => useThingOrThingById ( storeOrStoreId , Offsets . Store ) ;
547+ ) : Store | undefined => useThingOrThingById ( storeOrStoreId , OFFSET_STORE ) ;
539548
540549export const useProvideStore : typeof useProvideStoreDecl = (
541550 storeId : Id ,
542551 store : Store ,
543- ) : void => useProvideThing ( storeId , store , Offsets . Store ) ;
552+ ) : void => useProvideThing ( storeId , store , OFFSET_STORE ) ;
544553
545554export const useCreateMergeableStore : typeof useCreateMergeableStoreDecl = (
546555 create : ( ) => MergeableStore ,
@@ -1396,21 +1405,21 @@ export const useCreateMetrics: typeof useCreateMetricsDecl = (
13961405) : Metrics | undefined => useCreate ( store , create , createDeps ) ;
13971406
13981407export const useMetricsIds : typeof useMetricsIdsDecl = ( ) =>
1399- useThingIds ( Offsets . Metrics ) ;
1408+ useThingIds ( OFFSET_METRICS ) ;
14001409
14011410export const useMetrics : typeof useMetricsDecl = (
14021411 id ?: Id ,
1403- ) : Metrics | undefined => useThing ( id , Offsets . Metrics ) ;
1412+ ) : Metrics | undefined => useThing ( id , OFFSET_METRICS ) ;
14041413
14051414export const useMetricsOrMetricsById : typeof useMetricsOrMetricsByIdDecl = (
14061415 metricsOrMetricsId ?: MetricsOrMetricsId ,
14071416) : Metrics | undefined =>
1408- useThingOrThingById ( metricsOrMetricsId , Offsets . Metrics ) ;
1417+ useThingOrThingById ( metricsOrMetricsId , OFFSET_METRICS ) ;
14091418
14101419export const useProvideMetrics : typeof useProvideMetricsDecl = (
14111420 metricsId : Id ,
14121421 metrics : Metrics ,
1413- ) : void => useProvideThing ( metricsId , metrics , Offsets . Metrics ) ;
1422+ ) : void => useProvideThing ( metricsId , metrics , OFFSET_METRICS ) ;
14141423
14151424export const useMetricIds : typeof useMetricIdsDecl = (
14161425 metricsOrMetricsId ?: MetricsOrMetricsId ,
@@ -1453,21 +1462,21 @@ export const useCreateIndexes: typeof useCreateIndexesDecl = (
14531462) : Indexes | undefined => useCreate ( store , create , createDeps ) ;
14541463
14551464export const useIndexesIds : typeof useIndexesIdsDecl = ( ) =>
1456- useThingIds ( Offsets . Indexes ) ;
1465+ useThingIds ( OFFSET_INDEXES ) ;
14571466
14581467export const useIndexes : typeof useIndexesDecl = (
14591468 id ?: Id ,
1460- ) : Indexes | undefined => useThing ( id , Offsets . Indexes ) ;
1469+ ) : Indexes | undefined => useThing ( id , OFFSET_INDEXES ) ;
14611470
14621471export const useIndexesOrIndexesById : typeof useIndexesOrIndexesByIdDecl = (
14631472 indexesOrIndexesId ?: IndexesOrIndexesId ,
14641473) : Indexes | undefined =>
1465- useThingOrThingById ( indexesOrIndexesId , Offsets . Indexes ) ;
1474+ useThingOrThingById ( indexesOrIndexesId , OFFSET_INDEXES ) ;
14661475
14671476export const useProvideIndexes : typeof useProvideIndexesDecl = (
14681477 indexesId : Id ,
14691478 indexes : Indexes ,
1470- ) : void => useProvideThing ( indexesId , indexes , Offsets . Indexes ) ;
1479+ ) : void => useProvideThing ( indexesId , indexes , OFFSET_INDEXES ) ;
14711480
14721481export const useSliceIds : typeof useSliceIdsDecl = (
14731482 indexId : Id ,
@@ -1537,23 +1546,23 @@ export const useCreateRelationships: typeof useCreateRelationshipsDecl = (
15371546) : Relationships | undefined => useCreate ( store , create , createDeps ) ;
15381547
15391548export const useRelationshipsIds : typeof useRelationshipsIdsDecl = ( ) =>
1540- useThingIds ( Offsets . Relationships ) ;
1549+ useThingIds ( OFFSET_RELATIONSHIPS ) ;
15411550
15421551export const useRelationships : typeof useRelationshipsDecl = (
15431552 id ?: Id ,
1544- ) : Relationships | undefined => useThing ( id , Offsets . Relationships ) ;
1553+ ) : Relationships | undefined => useThing ( id , OFFSET_RELATIONSHIPS ) ;
15451554
15461555export const useRelationshipsOrRelationshipsById : typeof useRelationshipsOrRelationshipsByIdDecl =
15471556 (
15481557 relationshipsOrRelationshipsId ?: RelationshipsOrRelationshipsId ,
15491558 ) : Relationships | undefined =>
1550- useThingOrThingById ( relationshipsOrRelationshipsId , Offsets . Relationships ) ;
1559+ useThingOrThingById ( relationshipsOrRelationshipsId , OFFSET_RELATIONSHIPS ) ;
15511560
15521561export const useProvideRelationships : typeof useProvideRelationshipsDecl = (
15531562 relationshipsId : Id ,
15541563 relationships : Relationships ,
15551564) : void =>
1556- useProvideThing ( relationshipsId , relationships , Offsets . Relationships ) ;
1565+ useProvideThing ( relationshipsId , relationships , OFFSET_RELATIONSHIPS ) ;
15571566
15581567export const useRelationshipIds : typeof useRelationshipIdsDecl = (
15591568 relationshipsOrRelationshipsId ?: RelationshipsOrRelationshipsId ,
@@ -1652,21 +1661,21 @@ export const useCreateQueries: typeof useCreateQueriesDecl = (
16521661) : Queries | undefined => useCreate ( store , create , createDeps ) ;
16531662
16541663export const useQueriesIds : typeof useQueriesIdsDecl = ( ) =>
1655- useThingIds ( Offsets . Queries ) ;
1664+ useThingIds ( OFFSET_QUERIES ) ;
16561665
16571666export const useQueries : typeof useQueriesDecl = (
16581667 id ?: Id ,
1659- ) : Queries | undefined => useThing ( id , Offsets . Queries ) ;
1668+ ) : Queries | undefined => useThing ( id , OFFSET_QUERIES ) ;
16601669
16611670export const useQueriesOrQueriesById : typeof useQueriesOrQueriesByIdDecl = (
16621671 queriesOrQueriesId ?: QueriesOrQueriesId ,
16631672) : Queries | undefined =>
1664- useThingOrThingById ( queriesOrQueriesId , Offsets . Queries ) ;
1673+ useThingOrThingById ( queriesOrQueriesId , OFFSET_QUERIES ) ;
16651674
16661675export const useProvideQueries : typeof useProvideQueriesDecl = (
16671676 queriesId : Id ,
16681677 queries : Queries ,
1669- ) : void => useProvideThing ( queriesId , queries , Offsets . Queries ) ;
1678+ ) : void => useProvideThing ( queriesId , queries , OFFSET_QUERIES ) ;
16701679
16711680export const useQueryIds : typeof useQueryIdsDecl = (
16721681 queriesOrQueriesId ?: QueriesOrQueriesId ,
@@ -1902,22 +1911,22 @@ export const useCreateCheckpoints: typeof useCreateCheckpointsDecl = (
19021911) : Checkpoints | undefined => useCreate ( store , create , createDeps ) ;
19031912
19041913export const useCheckpointsIds : typeof useCheckpointsIdsDecl = ( ) =>
1905- useThingIds ( Offsets . Checkpoints ) ;
1914+ useThingIds ( OFFSET_CHECKPOINTS ) ;
19061915
19071916export const useCheckpoints : typeof useCheckpointsDecl = (
19081917 id ?: Id ,
1909- ) : Checkpoints | undefined => useThing ( id , Offsets . Checkpoints ) ;
1918+ ) : Checkpoints | undefined => useThing ( id , OFFSET_CHECKPOINTS ) ;
19101919
19111920export const useCheckpointsOrCheckpointsById : typeof useCheckpointsOrCheckpointsByIdDecl =
19121921 (
19131922 checkpointsOrCheckpointsId ?: CheckpointsOrCheckpointsId ,
19141923 ) : Checkpoints | undefined =>
1915- useThingOrThingById ( checkpointsOrCheckpointsId , Offsets . Checkpoints ) ;
1924+ useThingOrThingById ( checkpointsOrCheckpointsId , OFFSET_CHECKPOINTS ) ;
19161925
19171926export const useProvideCheckpoints : typeof useProvideCheckpointsDecl = (
19181927 checkpointsId : Id ,
19191928 checkpoints : Checkpoints ,
1920- ) : void => useProvideThing ( checkpointsId , checkpoints , Offsets . Checkpoints ) ;
1929+ ) : void => useProvideThing ( checkpointsId , checkpoints , OFFSET_CHECKPOINTS ) ;
19211930
19221931export const useCheckpointIds : typeof useCheckpointIdsDecl = (
19231932 checkpointsOrCheckpointsId ?: CheckpointsOrCheckpointsId ,
@@ -2100,20 +2109,20 @@ export const useCreatePersister: typeof useCreatePersisterDecl = <
21002109} ;
21012110
21022111export const usePersisterIds : typeof usePersisterIdsDecl = ( ) =>
2103- useThingIds ( Offsets . Persister ) ;
2112+ useThingIds ( OFFSET_PERSISTER ) ;
21042113
21052114export const usePersister : typeof usePersisterDecl = (
21062115 id ?: Id ,
2107- ) : AnyPersister | undefined => useThing ( id , Offsets . Persister ) ;
2116+ ) : AnyPersister | undefined => useThing ( id , OFFSET_PERSISTER ) ;
21082117
21092118export const usePersisterOrPersisterById : typeof usePersisterOrPersisterByIdDecl =
21102119 ( persisterOrPersisterId ?: PersisterOrPersisterId ) : AnyPersister | undefined =>
2111- useThingOrThingById ( persisterOrPersisterId , Offsets . Persister ) ;
2120+ useThingOrThingById ( persisterOrPersisterId , OFFSET_PERSISTER ) ;
21122121
21132122export const useProvidePersister : typeof useProvidePersisterDecl = (
21142123 persisterId : Id ,
21152124 persister : AnyPersister ,
2116- ) : void => useProvideThing ( persisterId , persister , Offsets . Persister ) ;
2125+ ) : void => useProvideThing ( persisterId , persister , OFFSET_PERSISTER ) ;
21172126
21182127export const usePersisterStatus : typeof usePersisterStatusDecl = (
21192128 persisterOrPersisterId ?: PersisterOrPersisterId ,
@@ -2173,22 +2182,22 @@ export const useCreateSynchronizer: typeof useCreateSynchronizerDecl = <
21732182} ;
21742183
21752184export const useSynchronizerIds : typeof useSynchronizerIdsDecl = ( ) =>
2176- useThingIds ( Offsets . Synchronizer ) ;
2185+ useThingIds ( OFFSET_SYNCHRONIZER ) ;
21772186
21782187export const useSynchronizer : typeof useSynchronizerDecl = (
21792188 id ?: Id ,
2180- ) : Synchronizer | undefined => useThing ( id , Offsets . Synchronizer ) ;
2189+ ) : Synchronizer | undefined => useThing ( id , OFFSET_SYNCHRONIZER ) ;
21812190
21822191export const useSynchronizerOrSynchronizerById : typeof useSynchronizerOrSynchronizerByIdDecl =
21832192 (
21842193 synchronizerOrSynchronizerId ?: SynchronizerOrSynchronizerId ,
21852194 ) : Synchronizer | undefined =>
2186- useThingOrThingById ( synchronizerOrSynchronizerId , Offsets . Synchronizer ) ;
2195+ useThingOrThingById ( synchronizerOrSynchronizerId , OFFSET_SYNCHRONIZER ) ;
21872196
21882197export const useProvideSynchronizer : typeof useProvideSynchronizerDecl = (
21892198 persisterId : Id ,
21902199 persister : Synchronizer ,
2191- ) : void => useProvideThing ( persisterId , persister , Offsets . Synchronizer ) ;
2200+ ) : void => useProvideThing ( persisterId , persister , OFFSET_SYNCHRONIZER ) ;
21922201
21932202export const useSynchronizerStatus : typeof useSynchronizerStatusDecl = (
21942203 synchronizerOrSynchronizerId ?: SynchronizerOrSynchronizerId ,
0 commit comments