Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/Node/Stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ exports.onEnd = function (s) {
};
};

exports.onFinish = function (s) {
return function (f) {
return function () {
s.on("finish", f);
};
};
};

exports.onReadable = function (s) {
return function (f) {
return function () {
Expand Down
8 changes: 8 additions & 0 deletions src/Node/Stream.purs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module Node.Stream
, setEncoding
, onReadable
, onEnd
, onFinish
, onClose
, onError
, resume
Expand Down Expand Up @@ -196,6 +197,13 @@ foreign import onEnd
-> Eff eff Unit
-> Eff eff Unit

-- | Listen for `finish` events.
foreign import onFinish
:: forall w eff
. Writable w eff
-> Eff eff Unit
-> Eff eff Unit

-- | Listen for `close` events.
foreign import onClose
:: forall w eff
Expand Down