Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

don't require callback for synchronous identify functions #353

Merged
merged 1 commit into from
Aug 13, 2016

Conversation

noam3127
Copy link
Contributor

@noam3127 noam3127 commented Aug 2, 2016

Perhaps this is just a personal preference, but I believe that callbacks should only be required for functions that may perform asynchronous operations. For all synchronous functions, requiring a callback to be passed in may mislead devs into thinking that it's asynchronous and requires unnecessary consideration for control flow. Therefore, I made the callbacks optional for bot.identifyBot() and bot.identifyTeam() because there's absolutely nothing async taking place in those.

@anonrig
Copy link
Contributor

anonrig commented Aug 3, 2016

It's a good approach when using yield on ES6, but if you're not using it, it gives a synchronous feeling to a asynchronous function.

@benbrown
Copy link
Contributor

I will allow it! Thanks.

@benbrown benbrown merged commit 3ae09e3 into howdyai:master Aug 13, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants