mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-10 02:31:48 +00:00
commit
26c5920efe
@ -31,7 +31,7 @@ end
|
|||||||
|
|
||||||
--subscribe to an event
|
--subscribe to an event
|
||||||
--can be a specifically named event, or "everything" to get notified for any event
|
--can be a specifically named event, or "everything" to get notified for any event
|
||||||
--for "everything", the callback will recieve the event name as the first argument
|
--for "everything", the callback will receive the event name as the first argument
|
||||||
function pubsub:subscribe(event, callback)
|
function pubsub:subscribe(event, callback)
|
||||||
local callbacks = self.subscriptions[event]
|
local callbacks = self.subscriptions[event]
|
||||||
if not callbacks then
|
if not callbacks then
|
||||||
|
@ -14,7 +14,7 @@ local timer = class({
|
|||||||
})
|
})
|
||||||
|
|
||||||
--create a timer, with optional callbacks
|
--create a timer, with optional callbacks
|
||||||
--callbacks recieve as arguments:
|
--callbacks receive as arguments:
|
||||||
-- the current progress as a number from 0 to 1, so can be used for lerps
|
-- the current progress as a number from 0 to 1, so can be used for lerps
|
||||||
-- the timer object, so can be reset if needed
|
-- the timer object, so can be reset if needed
|
||||||
function timer:new(time, on_progress, on_finish)
|
function timer:new(time, on_progress, on_finish)
|
||||||
|
Loading…
Reference in New Issue
Block a user