devisr/events

Hooks-based events system, component of the Devisr Framework

dev-master 2018-06-12 21:35 UTC

This package is auto-updated.

Last update: 2024-05-13 11:23:13 UTC


README

Devisr Events is a hooks-based events library to help with plugin systems.

To listen to an event:

    Events::listen("event.name", function($arguments) {
        // do stuff here
        return [ 1, 2, 3 ]; // optionally pass new arguments to the event target
    });

To create and invoke an event:

    (new Event("event.name", function($arguments) {
        // default event actions go here
        return 1; // optionally pass a value to the event.name:end event 
    }))($arguments) // pass default event arguments