MCPcopy Index your code
hub / github.com/replicate/scribble-diffusion / onChange

Function onChange

components/canvas.js:31–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 }
30
31 const onChange = async () => {
32 const paths = await canvasRef.current.exportPaths();
33 localStorage.setItem("paths", JSON.stringify(paths, null, 2));
34
35 if (!paths.length) return;
36
37 setScribbleExists(true);
38
39 const data = await canvasRef.current.exportImage("png");
40 onScribble(data);
41 };
42
43 const undo = () => {
44 canvasRef.current.undo();

Callers 1

loadStartingPathsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected