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

Constructor does asynchronous tasks #51

Open
fontanierh opened this issue Jul 12, 2016 · 1 comment
Open

Constructor does asynchronous tasks #51

fontanierh opened this issue Jul 12, 2016 · 1 comment

Comments

@fontanierh
Copy link

The constructor performs asynchronous request to the Slack rtm.start method. The getChannel method of this module relies on the information gathered from this request and may fail when called right after construction.

@SimonJang
Copy link
Contributor

What is the desired behavior here? Asynchronous behavior in constructor is undesired in my opinion. Perhaps there needs to be a .init() or .connect() method that covers the asynchronous behavior of the constructor? This is breaking change though.

The methods relying on the data from the constructor could also throw an error when the data is still undefined. This could be retried at some point in the future.

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

No branches or pull requests

3 participants