git ssb

1+

Matt McKegg / mutant



Tree: 6cbb0cdc8dd11c5f29e9c875e9f602f1d9a21f2a

Files: 6cbb0cdc8dd11c5f29e9c875e9f602f1d9a21f2a / lib / invalidate-next-tick.js

266 bytesRaw
1var queue = []
2
3module.exports = function (item) {
4 if (queue.length === 0) {
5 setImmediate(flush)
6 }
7 queue.push(item)
8}
9
10function flush () {
11 while (queue.length) {
12 var item = queue.pop()
13 if (!item.bound) {
14 item.invalidated = true
15 }
16 }
17}
18

Built with git-ssb-web