MCPcopy Index your code
hub / github.com/srcbookdev/srcbook / onDeleteCell

Function onDeleteCell

packages/web/src/routes/session.tsx:162–176  ·  view source on GitHub ↗
(cell: CellType | GenerateAICellType)

Source from the content-addressed store, hash-verified

160 });
161
162 async function onDeleteCell(cell: CellType | GenerateAICellType) {
163 if (!channel) {
164 return;
165 }
166 if (cell.type !== 'code' && cell.type !== 'markdown') {
167 throw new Error(`Cannot delete cell of type '${cell.type}'`);
168 }
169
170 // Optimistically delete cell
171 removeCell(cell);
172
173 channel.push('cell:delete', {
174 cellId: cell.id,
175 });
176 }
177
178 useEffect(() => {
179 if (!channel) {

Callers 3

HeaderFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected