Event based JavaScript for the browser with comprehensive event management API
91
Build an event registry that pre-registers event names to enable pattern-based event operations.
Your application needs an event registry where event names are defined upfront. This allows using regular expression patterns to attach listeners and emit events to multiple related events at once (e.g., all events starting with "user.").
Create a module that exports a createEventRegistry() function. The returned registry should:
/app\..*/ that executes when "app.started" is emitted @test/user\..*/ to respond to all three @test/data\..*/ triggers all listeners attached to these events @test@generates
/**
* Creates and returns an event registry instance
* @returns {Object} An event registry with registration methods
*/
function createEventRegistry() {
// IMPLEMENTATION HERE
}
module.exports = { createEventRegistry };Provides event management functionality with support for event definition and pattern matching.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-wolfy87-eventemitterdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10