MCPcopy
hub / github.com/tinyplex/tinybase / useEditable

Function useEditable

src/ui-react-inspector/editable.ts:8–20  ·  view source on GitHub ↗
(
  uniqueId: Id,
  s: Store,
)

Source from the content-addressed store, hash-verified

6import {useCell} from '../ui-react/index.ts';
7
8export const useEditable = (
9 uniqueId: Id,
10 s: Store,
11): [boolean, (event: SyntheticEvent<HTMLImageElement>) => void] => [
12 !!useCell(STATE_TABLE, uniqueId, EDITABLE_CELL, s),
13 useCallback(
14 (event: SyntheticEvent<HTMLImageElement>) => {
15 s.setCell(STATE_TABLE, uniqueId, EDITABLE_CELL, (editable) => !editable);
16 event.preventDefault();
17 },
18 [s, uniqueId],
19 ),
20];

Callers 5

SliceViewFunction · 0.90
TableViewFunction · 0.90
TablesViewFunction · 0.90
ValuesViewFunction · 0.90
RelationshipViewFunction · 0.90

Calls 2

useCellFunction · 0.90
setCellMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…