Skip to content

Commit

Permalink
docs: clarify listener invoked if already finished
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Dec 23, 2014
1 parent 7a8a793 commit 051c7af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ var onFinished = require('on-finished')

Attach a listener to listen for the response to finish. The listener will
be invoked only once when the response finished. If the response finished
to to an error, the first argument will contain the error.
to to an error, the first argument will contain the error. If the response
has already finished, the listener will be invoked.

Listening to the end of a response would be used to close things associated
with the response, like open files.
Expand All @@ -39,7 +40,8 @@ onFinished(res, function (err) {

Attach a listener to listen for the request to finish. The listener will
be invoked only once when the request finished. If the request finished
to to an error, the first argument will contain the error.
to to an error, the first argument will contain the error. If the request
has already finished, the listener will be invoked.

Listening to the end of a request would be used to know when to continue
after reading the data.
Expand Down

0 comments on commit 051c7af

Please sign in to comment.