Skip to content

Add callback option #18

Closed
wants to merge 4 commits into from

3 participants

@simme
simme commented Nov 4, 2012

I have a stream that reads filenames from a directory, and in the data callback I load the files and do some processing on them. The stream however emits end as soon as the file list has been read, which is long before I've actually processed the input and called all the .ticks() I need.

I therefore needed a callback that I could be sure was run when the processing of all the files was actually done. This seemed like a nice solution, not making me have to implement counters and stuff when the progress bar already has 'em :)

@simme
simme commented Nov 4, 2012

Just realized I completely missed the usage example that checks .complete after calling .tick().
Having a callback function could still be useful if .tick() is called from a different context then the one the bar is created in though.

It's up to you TJ! :D

@simme
simme commented Jan 28, 2013

Is this thing still maintained? ^^

@hallas
hallas commented Sep 8, 2013

@simme it is now, gonna take a look at this

@hallas
hallas commented Sep 8, 2013

I could live with this, but the callback option should default to null, not false, since it's not a boolean

@hallas
options.callback || null
@hallas
hallas commented Oct 5, 2013

@simme anything?

@simme
simme commented Oct 5, 2013

Yeah, I agree.

@hallas
hallas commented Oct 5, 2013

Will you update the PR?

@simme
simme commented Oct 9, 2013

There you go!

@jdan
jdan commented Oct 9, 2013

Landed in 0867c0a. Thanks!

@jdan jdan closed this Oct 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.