Skip to content

UseTable

Defined in: react/index.ts:136

G extends AnyGame

act: <K>(name, ...input) => Promise<ActResult | null>

Defined in: react/index.ts:155

Runs an action. Never rejects: on failure it resolves null and sets actionError. Use table.act() directly if you want a rejecting promise.

K extends string

K

...ActArgs<G, K>

Promise<ActResult | null>


actionError: Error | null

Defined in: react/index.ts:150

The last error from act, sit, stand or leave (cleared by the next success).


doc: TableDocument | null

Defined in: react/index.ts:141


error: Error | null

Defined in: react/index.ts:139


leave: () => Promise<boolean>

Defined in: react/index.ts:163

Promise<boolean>


meta: TypedTableMeta<G> | null

Defined in: react/index.ts:143


mySeat: number | null

Defined in: react/index.ts:146


pending: number

Defined in: react/index.ts:148

Number of actions awaiting their ack.


seats: SeatInfo[]

Defined in: react/index.ts:144


sit: (seat?) => Promise<number | null>

Defined in: react/index.ts:160

Takes a seat: resolves the seat number, or null on failure (see actionError).

number

Promise<number | null>


stand: (seat?) => Promise<boolean>

Defined in: react/index.ts:162

Resolves true on success, false on failure (see actionError).

number

Promise<boolean>


status: "error" | "closed" | "idle" | "joining" | "ready"

Defined in: react/index.ts:138

joining until the first snapshot, then ready; error if joining failed.


table: TableHandle<G> | null

Defined in: react/index.ts:140


view: GameView<G> | null

Defined in: react/index.ts:142


you: { player: string; role: "player" | "spectator"; seats: number[]; } | null

Defined in: react/index.ts:145