MCPcopy Create free account
hub / github.com/dailydotdev/apps / play

Function play

packages/shared/src/features/patchy/patchyIdle.ts:118–134  ·  view source on GitHub ↗
(name: PatchyIdleActionName)

Source from the content-addressed store, hash-verified

116 timers.add(id);
117 };
118 const play = (name: PatchyIdleActionName) => {
119 if (document.hidden) {
120 return;
121 }
122 const action: PatchyIdleAction = patchyIdleActions[name];
123 isBusy = true;
124 keyRef.current += 1;
125 setState({
126 face: action.face,
127 motion: prefersReducedMotion ? null : (action.motion ?? null),
128 key: keyRef.current,
129 });
130 later(() => {
131 isBusy = false;
132 setState((current) => ({ ...current, face: null, motion: null }));
133 }, action.ms);
134 };
135 const blinkLoop = () => {
136 later(() => {
137 if (!isBusy) {

Callers 3

blinkLoopFunction · 0.70
actionLoopFunction · 0.70
onPointerOverFunction · 0.70

Calls 1

laterFunction · 0.85

Tested by

no test coverage detected