MCPcopy Index your code
hub / github.com/tinyplex/tinybase / rootRowChanged

Function rootRowChanged

src/queries/index.ts:794–819  ·  view source on GitHub ↗
(
            sourceStore: Store,
            _tableId: Id,
            rootRowId: Id,
          )

Source from the content-addressed store, hash-verified

792
793 const {3: toJoinAliases} = mapGet(joins, undefined) as JoinClause;
794 const rootRowChanged = (
795 sourceStore: Store,
796 _tableId: Id,
797 rootRowId: Id,
798 ) => {
799 if (rootStore.hasRow(tableId, rootRowId)) {
800 listenToTable(
801 rootRowId,
802 rootStore,
803 tableId,
804 rootRowId,
805 toJoinAliases,
806 );
807 } else {
808 selectJoinWhereStore.delRow(queryId, rootRowId);
809 collForEach(joins, ({4: idsByRootRowId}) =>
810 ifNotUndefined(
811 mapGet(idsByRootRowId, rootRowId),
812 ([, sourceStore, listenerId]) => {
813 delSourceStoreListeners(queryId, sourceStore, listenerId);
814 mapSet(idsByRootRowId, rootRowId);
815 },
816 ),
817 );
818 }
819 };
820
821 selectJoinWhereStore.transaction(() => {
822 arrayForEach(rootStore.getRowIds(tableId), (rootRowId) =>

Callers 1

setQueryDefinitionImplFunction · 0.70

Calls 7

collForEachFunction · 0.90
mapGetFunction · 0.90
mapSetFunction · 0.90
listenToTableFunction · 0.70
delSourceStoreListenersFunction · 0.70
hasRowMethod · 0.65
delRowMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…