Skip to content

SharedGame beta ​

Interface of @v12-engine/engine

ts
export interface SharedGame

A game shared for watching (shareGame)

Members ​

close ​

ts
close(): void;

Stops sharing: the watchers are told it ended

onChange ​

ts
onChange(handler: () => void): void;

Told whenever the state or the number of watchers changes

state ​

ts
readonly state: 'shared' | 'taken' | 'closed';

shared once the relay has it; taken when another page shares under the key; closed once it is over

watchers ​

ts
readonly watchers: number;

How many watch it now