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

Function getUseCheckpointView

src/ui-solid/common/index.tsx:132–167  ·  view source on GitHub ↗
(getCheckpoints: (checkpointIds: CheckpointIds) => Ids)

Source from the content-addressed store, hash-verified

130
131export const getUseCheckpointView =
132 (getCheckpoints: (checkpointIds: CheckpointIds) => Ids) =>
133 (
134 props: (
135 | BackwardCheckpointsProps
136 | CurrentCheckpointProps
137 | ForwardCheckpointsProps
138 ) & {
139 separator?: JSXElement | string;
140 },
141 ): JSXElement => {
142 const resolvedCheckpoints = useCheckpointsOrCheckpointsById(
143 () => props.checkpoints,
144 );
145 const checkpointIds = useCheckpointIds(resolvedCheckpoints);
146 const content = () => {
147 const Checkpoint = props.checkpointComponent ?? CheckpointView;
148 return wrap(
149 arrayMap(
150 getCheckpoints(getValue(checkpointIds) as CheckpointIds),
151 (checkpointId: Id) => (
152 <Checkpoint
153 {...getProps(
154 props.getCheckpointComponentProps,
155 checkpointId as Id,
156 )}
157 checkpoints={getValue(resolvedCheckpoints)}
158 checkpointId={checkpointId}
159 debugIds={props.debugIds}
160 />
161 ),
162 ),
163 props.separator,
164 );
165 };
166 return <>{content()}</>;
167 };

Calls 3

useCheckpointIdsFunction · 0.90
contentFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…