MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / callIfFn

Function callIfFn

src/ts-default/Backgrounds/Lightfall/Lightfall.tsx:341–346  ·  view source on GitHub ↗
(obj: unknown, key: string)

Source from the content-addressed store, hash-verified

339 container.removeChild(canvas);
340 }
341 const callIfFn = (obj: unknown, key: string) => {
342 const fn = obj && (obj as Record<string, unknown>)[key];
343 if (typeof fn === 'function') {
344 (fn as () => void).call(obj);
345 }
346 };
347 callIfFn(programRef.current, 'remove');
348 callIfFn(geometryRef.current, 'remove');
349 callIfFn(meshRef.current, 'remove');

Callers 1

LightfallFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected