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

Function Nub

src/ui-react-inspector/Nub.tsx:5–12  ·  view source on GitHub ↗
({s}: StoreProp)

Source from the content-addressed store, hash-verified

3import {useSetValueCallback, useValue} from '../ui-react/index.ts';
4
5export const Nub = ({s}: StoreProp) => {
6 const position = useValue(POSITION_VALUE, s) ?? 1;
7 const handleOpen = useSetValueCallback(OPEN_VALUE, () => true, [], s);
8
9 return useValue(OPEN_VALUE, s) ? null : (
10 <img onClick={handleOpen} title={TITLE} data-position={position} />
11 );
12};

Callers

nothing calls this directly

Calls 2

useValueFunction · 0.90
useSetValueCallbackFunction · 0.90

Tested by

no test coverage detected