mazey
    Preparing search index...

    Variable addEventConst

    addEvent: (type: string, fn: MazeyFn) => void = onEvent

    Deprecated alias of onEvent.

    Type Declaration

      • (type: string, fn: MazeyFn): void
      • Register a named Mazey event callback.

        Usage:

        import { fireEvent, onEvent } from "mazey";

        onEvent("test", (e) => {
        console.log("test event:", e);
        });
        fireEvent("test", { type: "test" });

        Output:

        test event: { type: "test" }
        

        Parameters

        • type: string
        • fn: MazeyFn

        Returns void

    Use onEvent instead.