Skip to content

Instantly share code, notes, and snippets.

@apaleslimghost
Created August 14, 2013 14:24
Show Gist options
  • Save apaleslimghost/6231533 to your computer and use it in GitHub Desktop.
Save apaleslimghost/6231533 to your computer and use it in GitHub Desktop.
Readable::chain = (f)->
orig = this
new class extends Readable
_read: (size)->
if (orig.read size)?
if ((f that)read size)?
@push that
else @push ""
else
@push null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment