リファレンス
Reactフック
import { … } from "@johnmorrisdotca/narabe/react";
最小化と gzip 圧縮をしたサイズは 27.1 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
useNarabe, a React hook over the engine: one game's state and the moves a
board can make on it. It adds no rule of its own; every action is the
engine function of the same name, and an illegal one leaves the state as it
was, exactly as the engine does.
Drawing the board is left to you, because every app draws its boards its own way. The demo in this repository draws one in plain SVG.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
NarabeGame | 型 | A React game state and its native move, replay and reset actions. |
useNarabe | 関数 | One game, kept in React state. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。