UNPKG

pull-looper

Version:

unwind the stack while reading recursively from a pull-stream

14 lines (12 loc) 227 B
var looper = require('looper') module.exports = function (read) { var _abort, _cb var loop = looper(function () { read(_abort, _cb) }) return function (abort, cb) { _abort = abort _cb = cb loop() } }