gameplate - v2.3.0
    Preparing search index...

    Type Alias Dispatch<A>

    Dispatch: {
        [K in keyof A]: A[K] extends (state: never, ...args: infer P) => unknown
            ? (...args: P) => void
            : never
    }

    Turn an ActionMap into a dispatch object: each entry becomes a function with the state argument stripped. Calling it applies the action and returns void.

    This is the type magic behind game.actions.move(5, 0) working with full IntelliSense even though the underlying handler was (state, dx, dy) => newState.

    Type Parameters

    • A