Skip to content

snapshotOf beta ​

Function of @v12-engine/engine

ts
export declare function snapshotOf<T, S>(state: {
    components?: Record<string, unknown>;
}, component: Component<T, S>): S | undefined;

What a snapshot carries of a component, typed: snapshotOf(entity.state, shopStock) on a screen, or in a computer player's view. undefined when the player was not told it