setHeldActionfunction
Starts or releases one held action; opposite lateral holds cancel during scheduling.
Import it
import { setHeldAction } from "@johnmorrisdotca/houseki/falling-triplets";
Definition
function setHeldAction(state: InputSchedulerState, action: HoldAction, held: boolean): InputSchedulerState
Parameters
| Name | Type | Description |
|---|---|---|
state | InputSchedulerState | The immutable native state to read or transition; the input is retained. |
action | HoldAction | One native action for this entry point; inspect accepted and reason on the result. |
held | boolean | Whether this input is currently held. |
Returns
InputSchedulerState
Starts or releases one held action; opposite lateral holds cancel during scheduling.
Examples
import { createInputScheduler, setHeldAction } from "@johnmorrisdotca/houseki/falling-triplets";
const input=createInputScheduler();
console.log(setHeldAction(input,"left",true));{ held: { left: 0 }, queued: [] }What it prints (run when this page was built)