git ssb

2+

Dominic / pull-stream



Tree: 9e8b7714e605551f6eb22a0160194142cb7c3e47

Files: 9e8b7714e605551f6eb22a0160194142cb7c3e47 / 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