• Cleans any event channel created on the given target. Un-registers any event listener.

    Parameters

    • target: any

      the channel object.

    Returns void

    // object as event channel
    const channel = {};

    // connect to event "changed"
    on(channel, "changed", (msg)=> console.log(msg));

    // clean channel
    cleanup(channel);
    // the listener registered by on will never receive events.