refactor(pipe) create: add ifExec

This commit is contained in:
coderaiser 2013-10-04 08:24:15 +00:00
parent 109e412ae7
commit beca4c609f

View file

@ -45,15 +45,12 @@
lWrite.on('error', lError);
lRead.on('error', lError);
if (lIsFsWrite)
lWrite.on('open', function() {
lRead.pipe(lWrite);
lRead.on('end', Util.retExec(p.callback));
});
else {
Util.ifExec(!lIsFsWrite, function() {
lRead.pipe(lWrite);
lRead.on('end', Util.retExec(p.callback));
}
}, function(pCallBack) {
lWrite.on('open', pCallBack);
});
}
};