
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@pbuk/game-loop
Advanced tools
A game loop for browser.
Include game-loop from CDN.
<script src="https://cdn.jsdelivr.net/npm/@pbuk/game-loop@1"></script>
Create the callbacks that define the game.
const config = {
// Things that stay the same.
};
const getInitialState = (config) => {
return {
// Things that change.
};
};
const update = ({ config, state, frameLength, runTime, gameState }) => {
// Update state (don't change anything else).
};
const render = ({ config, state, frameLength, runTime, gameState }) => {
// Update all displays (don't change anything).
};
Create and manage the game loop.
// Set up the game and call `update` and `render` once with gameState = 'notStarted'.
const { start, stop, reset } = GameLoop.createGame({ config, getInitialState, update, render });
// Starts the game running, or resumes after `stop()`.
start();
// Stops the game (can be resumed with `start()`).
stop();
// Stops the game and resets the state to the initial state.
reset();
FAQs
Game loop for browser
We found that @pbuk/game-loop demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.