Reference · Native peg-solitaire player
mountfunction
Mount one independent player. The host owns persistence through onChange and setGame.
Import it
import { mount } from "@johnmorrisdotca/tobiishi/play";
Definition
function mount(host: HTMLElement, options?: MountOptions): Player
Parameters
| Name | Type | Description |
|---|---|---|
host | HTMLElement | The element that owns this player and its controls. |
options (optional) | MountOptions | Initial puzzle, presentation and persistence callback. |
Returns
Player
A player with game access, replacement, presentation updates and cleanup.
Examples
import { mount } from "@johnmorrisdotca/tobiishi/play";
if (typeof document !== "undefined") {
const player = mount(document.createElement("div"));
player.set({ material: "wood", language: "ja" });
player.destroy();
}
console.log(typeof mount);functionWhat it prints (run when this page was built)