Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete callback passed to start method doesn't work #22

Open
g-serghei opened this issue Sep 29, 2016 · 4 comments
Open

Complete callback passed to start method doesn't work #22

g-serghei opened this issue Sep 29, 2016 · 4 comments
Labels

Comments

@g-serghei
Copy link

When using this construction:

this.loadingBar.start(() => {
    console.log('completed');
});

the complete callback is not called, it seems that you did not implemented it in your source code

start(onCompleted:Function = null) {
    // Stop current timer
    this.stop();
    // Make it visible for sure
    this.visible = true;
    // Run the timer with milliseconds iterval
    this._intervalCounterId = setInterval(() => {
        // Increment the progress and update view component
        this.progress++;
        // If the progress is 100% - call complete
        if (this.progress === 100) {
            this.complete();
        }
    }, this.interval);
}
@niyazhussain
Copy link

This is not done yet , i too had the same problem. But in my case i dont want to do anything after that , perhaps you can include an EventEmitter in his code.

@akserg akserg added the bug label Oct 2, 2016
@akserg
Copy link
Owner

akserg commented Oct 2, 2016

Thanks all
I think it would be better to return the Promise as a result of this file. Will fix it soon.

@theoomoregbee
Copy link
Contributor

no update yet on this issue

@theoomoregbee
Copy link
Contributor

gotten a way around it, subscribed to thethis._loadingBar.events.subscribe(item => console.log(item)); then if it is of progress we can check the percentage and then check if it is 100% or not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants