Skip to content

Instantly share code, notes, and snippets.

View ShayDavidson's full-sized avatar

Shay Davidson ShayDavidson

View GitHub Profile
@ShayDavidson
ShayDavidson / builder.json
Created May 16, 2023 05:43
Override rollup executor
{
"builders": {
"rollup": {
"implementation": "./impl",
"schema": "./schema.json",
"description": "Custom rollup executor"
}
}
}
import { useCallback, useEffect, useRef, MutableRefObject } from 'react';
export interface UseGameLoopOptions {
shouldPauseOnBlur?: boolean;
shouldResumeOnFocus?: boolean;
}
export interface GameLoopContext {
state: MutableRefObject<'playing' | 'paused' | 'stopped'>;
start: () => void;