feat(timers): allow passing additional parameters to timers
This commit is contained in:
@@ -9,13 +9,13 @@ class TimerMgr {
|
||||
log.info('Initialization of TimerMgr helper class');
|
||||
}
|
||||
|
||||
create(id, timeout, func) {
|
||||
create(id, timeout, func, ...params) {
|
||||
if (this.hasTimer(id)) {
|
||||
log.error(`Timer with id ${id} already exists`);
|
||||
return;
|
||||
}
|
||||
log.debug("Create timer with id " + id);
|
||||
this.#timers[id] = actions.ScriptExecution.createTimer(id, timeout, func);
|
||||
this.#timers[id] = actions.ScriptExecution.createTimer(id, timeout, func, ...params);
|
||||
}
|
||||
|
||||
cancel(id) {
|
||||
|
||||
Reference in New Issue
Block a user