miaoda-game-deck-react
v0.3.3
Published
React bindings for observable miaoda-game-deck-core zones and card movement.
Readme
miaoda-game-deck-react
Use this React adapter to observe deck zones and card events, or to create a local deck instance for a mounted component.
Install and use
pnpm add miaoda-game-deck-core miaoda-game-deck-reactimport { useDeck, useDeckSnapshot } from 'miaoda-game-deck-react';
function Hand() {
const deck = useDeck({ zones: [{ id: 'hand' }, { id: 'draw', cards }] });
const snapshot = useDeckSnapshot(deck);
return <div>{snapshot.zones.hand.map((card) => <CardView key={card.id} card={card} />)}</div>;
}React observes committed deck changes; draw, play, shuffle, turn flow, persistence, and hidden-information projection remain game-owned. Do not send the complete snapshot to an untrusted player because it includes every zone and deterministic RNG state.
