aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2020-01-08 18:00:27 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2020-01-08 18:00:27 -0500
commit20702bf37916a7466bb3d8ca6865965d39c64f22 (patch)
tree1215d60346c644f516bb94104aeef3595748b7b2 /examples
parent97468a8c373bf11c77b1a39ee352de8b839bb77a (diff)
split out notifRefresh for extensibility
Diffstat (limited to 'examples')
-rw-r--r--examples/jarvis.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/jarvis.js b/examples/jarvis.js
index 73a39e5..433d2b0 100644
--- a/examples/jarvis.js
+++ b/examples/jarvis.js
@@ -48,7 +48,7 @@ function init(){
}
function initOnce(){
- notifRefresh();
+ timect();
}
function tileHandler(send, source, tiles){
@@ -82,8 +82,12 @@ function notifRefresh(){
notif = newnotif;
writes.enqueue(...diff.towrite());
ctrl = ms(notif);
- setTimeout(notifRefresh, 60*1000);
- minsUp += 1;
+}
+
+function timect(){
+ minsUp++;
+ notifRefresh();
+ setTimeout(timect, 60*1000);
}
function protectArea(send, tiles, locs){