pota/use/gamepadpota/use/gamepad exposes connect state, button presses, analog
triggers, and axis positions as reactive accessors, plus a
non-reactive snapshot for game loops.
The Gamepad API has no per-button events: state is sampled via
navigator.getGamepads() every frame. This module runs a singleton
requestAnimationFrame poll that starts on the first subscription and
stops once the last consumer disposes. Even connect / disconnect is
derived from the poll — one source of truth. Each reactive accessor
lazily allocates its backing signal the first time it's called for a
given (gamepad, button/axis) pair, so the poll only updates signals
consumers actually subscribed to.
useGamepadConnected(index?) —
reactive booleanuseGamepadButton(button, gamepad?)
— reactive booleanuseGamepadTrigger(button, gamepad?)
— reactive number 0..1useGamepadAxis(axis, gamepad?) —
reactive number -1..1gamepadSnapshot(index?) —
non-reactive Gamepad | null (no rAF poll)