MCPcopy Create free account
hub / github.com/tinyplex/tinybase / useCustomOrDefaultCellIds

Function useCustomOrDefaultCellIds

src/ui-solid/common/primitives.tsx:8–16  ·  view source on GitHub ↗
(
  customCellIds: MaybeAccessor<Ids | undefined>,
  tableId: MaybeAccessor<Id>,
  rowId: MaybeAccessor<Id>,
  store?: MaybeAccessor<StoreOrStoreId | undefined>,
)

Source from the content-addressed store, hash-verified

6import {useCellIds} from '../primitives.ts';
7
8export const useCustomOrDefaultCellIds = (
9 customCellIds: MaybeAccessor<Ids | undefined>,
10 tableId: MaybeAccessor<Id>,
11 rowId: MaybeAccessor<Id>,
12 store?: MaybeAccessor<StoreOrStoreId | undefined>,
13): (() => Ids) => {
14 const defaultCellIds = useCellIds(tableId, rowId, store);
15 return () => getValue(customCellIds) ?? getValue(defaultCellIds);
16};

Callers 1

RowViewFunction · 0.90

Calls 2

useCellIdsFunction · 0.90
getValueFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…