From edaffde9f32706d88b0c94fbb45d4746c8f43e54 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Wed, 8 Jan 2020 19:53:11 -0500 Subject: notifRefresh returns list of writes in jarvis --- examples/jarvis.js | 11 +++++------ 1 file 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); } -- cgit