git ssb

2+

Dominic / pull-stream



Tree: 4030fd72088498cc22acca950c4a1bb121937cc0

Files: 4030fd72088498cc22acca950c4a1bb121937cc0 / sources / once.js

300 bytesRaw
1var abortCb = require('../util/abort-cb')
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