How to both reset & set delay in "delay node"

Actually a simple function node can return two messages...

eg

msg.delay = 5000;
var m1 = {reset:true};
return [[m1,msg]];
[{"id":"f8275102.af47b","type":"inject","z":"a68cca8a.e5ba98","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":1560,"wires":[["193bbb8c.ee43a4"]]},{"id":"193bbb8c.ee43a4","type":"function","z":"a68cca8a.e5ba98","name":"","func":"msg.delay = 5000;\nvar m1 = {reset:true};\nreturn [[m1,msg]];","outputs":1,"noerr":0,"x":320,"y":1560,"wires":[["941932e.e9abcd"]]},{"id":"941932e.e9abcd","type":"delay","z":"a68cca8a.e5ba98","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":480,"y":1560,"wires":[["d02fef04.15e29"]]},{"id":"d02fef04.15e29","type":"debug","z":"a68cca8a.e5ba98","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":650,"y":1560,"wires":[]}]
1 Like