@randajan/jet-core
Advanced tools
Comparing version 3.4.3 to 3.4.4
@@ -11,3 +11,3 @@ import { | ||
} | ||
constructor({ onTick, onInit, onStart, onStop }) { | ||
constructor({ onTick, onInit, onStart, onStop, interval }) { | ||
onInit = jet_default.isRunnable(onInit) ? onInit : (_) => { | ||
@@ -23,3 +23,3 @@ }; | ||
state: false, | ||
interval: 1e3, | ||
interval: 0, | ||
count: 0, | ||
@@ -33,3 +33,6 @@ intervalId: null | ||
_p.count++; | ||
await onTick(this); | ||
try { | ||
await onTick(this); | ||
} catch (err) { | ||
} | ||
_p.intervalId = setTimeout(tick, _p.interval); | ||
@@ -70,2 +73,3 @@ }; | ||
virtual(this, "count", (_) => _p.count); | ||
this.setInterval(interval); | ||
} | ||
@@ -72,0 +76,0 @@ start() { |
{ | ||
"name": "@randajan/jet-core", | ||
"version": "3.4.3", | ||
"version": "3.4.4", | ||
"description": "Ecosystem of types and related usefull tools.", | ||
@@ -5,0 +5,0 @@ "repository": "randajan/jet-core", |
Sorry, the diff of this file is not supported yet
159662
1626