jazzdotdev / jazzdotdev/flute

Event trigering interface

Open
#54 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
17
Forks
4
PR merge metrics
No merged PRs in 30d

Description

The current interface for events is
~~~lua
events["lighttouch_loaded"] = luvent.newEvent()
events_actions["lighttouch_loaded"] = { } -- I don't understand what's this

events["incoming_request_received"]:addAction(action_function)

events["lighttouch_loaded"]:trigger({param = data})
~~~

Change it to
~~~lua
-- event is lazily created
get_event("lighttouch_loaded"):addAction(action_function)

-- this wouldn't fail on an event without actions (previously non existing) because it's created implicitly
trigger_event("lighttouch_loaded", {param = data})
~~~

Possibly even
~~~lua
add_event_action("lighttouch_loaded", action_function, optional_priority)
trigger_event("lighttouch_loaded", {param = data})
~~~

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.