aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolden Rohrer <holden.rohrer@gmail.com>2020-01-08 19:53:11 -0500
committerHolden Rohrer <holden.rohrer@gmail.com>2020-01-08 19:53:11 -0500
commitedaffde9f32706d88b0c94fbb45d4746c8f43e54 (patch)
treee9943ba779f2f3862ee0d6ab2377f06bbf154a66
parent5932a3eafcfa4c8ea1db44a90bf3a0f72996c624 (diff)
notifRefresh returns list of writes in jarvis
-rw-r--r--examples/jarvis.js11
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);
}