Sink should respect a readable event on the destination stream #142
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello 😄
by using grunt-contrib-imagemin I encountered a problem that I tracked down to vinyl-fs 2.3.0. If one attaches a listener to the
readable
event of thevinly-fs.dest
stream, the new sink (introduced in df97b14 ) prevents it from firing. I attached a test to this PR that hopefully explains the problem better.The problem is that the
pipe()
call insink.js
turns the stream into flowing mode. In this mode the stream does no longer emit areadable
event (see Node docs).This of course is a special case. Nevertheless the destination stream should not be turned into flowing mode if it's obvious that this was not intended. Imho that's the case if a developer adds a
readable
event listener, so I added a check for it.Feedback is much appreciated! 😄
Ben