Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Insality committed Sep 19, 2024
1 parent a6f81ec commit 6be0530
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,17 @@ Memory allocation tracking is turned off in release builds, regardless of the `g

```lua
local event = require("event.event")
event.create(callback, [callback_context])
event:subscribe(callback, [callback_context])
event:unsubscribe(callback, [callback_context])
event:is_subscribed(callback, [callback_context])
event:trigger(...)
event:is_empty()
event:clear()
event.set_logger(logger)
event.set_memory_threshold(threshold)

local event_instance = event.create(callback, [callback_context])
event_instance:subscribe(callback, [callback_context])
event_instance:unsubscribe(callback, [callback_context])
event_instance:is_subscribed(callback, [callback_context])
event_instance:trigger(...)
event_instance:is_empty()
event_instance:clear()

local events = require("event.events")
events.subscribe(name, callback, [callback_context])
events.unsubscribe(name, callback, [callback_context])
Expand Down

0 comments on commit 6be0530

Please sign in to comment.