UseTable
Defined in: react/index.ts:136
Type Parameters
Section titled “Type Parameters”G extends AnyGame
Properties
Section titled “Properties”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.
Type Parameters
Section titled “Type Parameters”K extends string
Parameters
Section titled “Parameters”K
...ActArgs<G, K>
Returns
Section titled “Returns”Promise<ActResult | null>
actionError
Section titled “actionError”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
Returns
Section titled “Returns”Promise<boolean>
meta:
TypedTableMeta<G> |null
Defined in: react/index.ts:143
mySeat
Section titled “mySeat”mySeat:
number|null
Defined in: react/index.ts:146
pending
Section titled “pending”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).
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Promise<number | null>
stand: (
seat?) =>Promise<boolean>
Defined in: react/index.ts:162
Resolves true on success, false on failure (see actionError).
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Promise<boolean>
status
Section titled “status”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
