mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-23 19:48:31 +00:00
fix dependency array
This commit is contained in:
parent
9afddf0850
commit
88684d6d9e
@ -12,8 +12,8 @@ function useStrudel({
|
|||||||
initialCode = '',
|
initialCode = '',
|
||||||
autolink = false,
|
autolink = false,
|
||||||
beforeEval,
|
beforeEval,
|
||||||
editPattern,
|
|
||||||
afterEval,
|
afterEval,
|
||||||
|
editPattern,
|
||||||
onEvalError,
|
onEvalError,
|
||||||
onToggle,
|
onToggle,
|
||||||
canvasId,
|
canvasId,
|
||||||
@ -105,11 +105,11 @@ function useStrudel({
|
|||||||
|
|
||||||
const inited = useRef();
|
const inited = useRef();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!inited.current && drawContext && onDraw && evalOnMount && code) {
|
if (!inited.current && evalOnMount && code) {
|
||||||
inited.current = true;
|
inited.current = true;
|
||||||
evaluate(code, false).then((pat) => drawFirstFrame(pat));
|
evaluate(code, false).then((pat) => drawFirstFrame(pat));
|
||||||
}
|
}
|
||||||
}, [activateCode, evalOnMount, code, drawFirstFrame]);
|
}, [evalOnMount, code, evaluate, drawFirstFrame]);
|
||||||
|
|
||||||
// this will stop the scheduler when hot reloading in development
|
// this will stop the scheduler when hot reloading in development
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user