Function addEvent

  • Add event.

    Usage:

    import { addEvent } from "mazey";

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

    Output:

    test event: { type: "test" }
    

    Parameters

    • type: string
    • fn: MazeyFn

    Returns void