Files: 455af00799601cb57c6ea54edad5e85c516b799f / lib / plugins / heartbeat.js
276 bytesRaw
1 | const Pushable = require('pull-pushable') |
2 | module.exports = function () { |
3 | return function () { |
4 | const stream = Pushable(() => { |
5 | clearInterval(timer) |
6 | }) |
7 | const timer = setInterval(function () { |
8 | stream.push(Date.now()) |
9 | }, 500) |
10 | return stream |
11 | } |
12 | } |
13 |
Built with git-ssb-web