git ssb

2+

Dominic / pull-stream



Tree: 22c80b9c74339096c81f7668440f2b298fad8116

Files: 22c80b9c74339096c81f7668440f2b298fad8116 / sources / once.js

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

Built with git-ssb-web