Interface StoreContainer<StateType, ActionType, HiddenType>

Represents a container for managing a store and handling actions within a game or application.

interface StoreContainer<StateType, ActionType, HiddenType = any> {
    hasHiddenState?: boolean;
    reducer: (ctx: Context<HiddenType>, action: ActionType) => void;
    store: Store<StateType>;
}

Type Parameters

  • StateType

    The type representing the state managed by the store.

  • ActionType

    The type representing the actions that can be dispatched.

  • HiddenType = any

    The type representing hidden objects, defaults to any.

Properties

hasHiddenState?: boolean

Whether the reducer uses hidden objects. Defaults to false.

reducer: (ctx: Context<HiddenType>, action: ActionType) => void

A reducer function that processes actions, and returns a new state. It typically validates the current player, and optionally interacts with hidden objects and a random generator.

The store instance that manages the application state.