Reference · Cube engine and views
KeepScramblingHandletype
What a running loop can be told.
Import it
import type { KeepScramblingHandle } from "@johnmorrisdotca/kyuubu";
Definition
type KeepScramblingHandle = {
start(): void;
stop(): void;
setPace(pace: number | ScramblePace): void;
readonly running: boolean;
destroy(): void;
};
Members
| Name | Type | Description |
|---|---|---|
start | (): void | Carry on, or begin. Does nothing while the page is hidden or motion is reduced; it starts when they allow it. |
stop | (): void | Stop turning. The cube stays as it is. |
setPace | (pace: number | ScramblePace): void | Change how often it turns, at once. |
running | boolean | Whether it has been asked to run and nothing is holding it back. |
destroy | (): void | Stop for good and let go of the page. |
Examples
import type { KeepScramblingHandle } from "@johnmorrisdotca/kyuubu";
import { keepScrambling } from "@johnmorrisdotca/kyuubu";
const value: KeepScramblingHandle = keepScrambling({ size: 3, busy: false, turn: () => {} }, { autoplay: false });
console.log(value.running);