git ssb

2+

Dominic / pull-stream



Tree: 7aa21412f6c0bd6b84022d67ff8e51711eddb510

Files: 7aa21412f6c0bd6b84022d67ff8e51711eddb510 / once.js

298 bytesRaw
1var abortCb = require('./util/abortCb')
2
3module.exports = function once (value, onAbort) {
4 return function (abort, cb) {
5 if(abort)
6 return abortCb(cb, abort, onAbort)
7 if(value != null) {
8 var _value = value; value = null
9 cb(null, _value)
10 } else
11 cb(true)
12 }
13}
14
15
16

Built with git-ssb-web