diff options
author | Holden Rohrer <holden.rohrer@gmail.com> | 2020-01-08 19:53:11 -0500 |
---|---|---|
committer | Holden Rohrer <holden.rohrer@gmail.com> | 2020-01-08 19:53:11 -0500 |
commit | edaffde9f32706d88b0c94fbb45d4746c8f43e54 (patch) | |
tree | e9943ba779f2f3862ee0d6ab2377f06bbf154a66 /examples | |
parent | 5932a3eafcfa4c8ea1db44a90bf3a0f72996c624 (diff) |
notifRefresh returns list of writes in jarvis
Diffstat (limited to 'examples')
-rw-r--r-- | examples/jarvis.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/jarvis.js b/examples/jarvis.js index 6df70fa..7d27901 100644 --- a/examples/jarvis.js +++ b/examples/jarvis.js @@ -84,7 +84,7 @@ var notifsrc = '\ \n\ For a node.js YWOT api: \n\ & http://github.com/feynmansfedora/ywot-clean \n\ -& Try `jarvis` today. Uptime: UPTIME. Called: JARVISx\n\ +& Try `jarvis` today. Uptime: UPTIME. Called: JARVISx \n\ ' var minsUp = 0; var callct = 0; @@ -99,14 +99,14 @@ function notifRefresh(){ let diff = newnotif.copy(); if (typeof notif !== 'undefined') diff.comb(notif, comb.sub); notif = newnotif; - writes.enqueue(...diff.towrite()); ctrl = ms(notif); + return (diff.towrite()); } function timect(){ - notifRefresh(); - setTimeout(timect, 60*1000); minsUp++; + writes.enqueue(...notifRefresh()); + setTimeout(timect, 60*1000); } function protectArea(send, tiles, locs){ @@ -155,8 +155,7 @@ response.adhoc('yes, my liege'); function respond(coord){ console.log('called at', coord); callct += 1; - notifRefresh(); response.loc = coord; - writes.enqueue(...response.towrite()); + writes.enqueue(...response.towrite().concat(notifRefresh())); read.update(response); } |