From 6be0530fe3d1aa2e1aadc290996f01e88041c44d Mon Sep 17 00:00:00 2001 From: Insality Date: Thu, 19 Sep 2024 19:58:49 +0300 Subject: [PATCH] Update README --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a4ddd9a..eea99ad 100644 --- a/README.md +++ b/README.md @@ -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])