-
Notifications
You must be signed in to change notification settings - Fork 145
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
Feature/subroutines with promises #78
Feature/subroutines with promises #78
Conversation
# Promise replyAsync (string username, string message [[, scope], callback]) | ||
# | ||
# Asyncronous version of reply. Use replyAsync if at least one of the subroutines | ||
# used with <call> tag returns a promise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add documentation for the callback
argument. It looks from the source that it should be a function that accepts (error, reply)
as parameters?
Also provide examples of both use cases, like
# Example: using promises
#
# ```javascript
# rs.replyAsync(user, message, this).then(function(error, reply) {
# console.log("Bot>", reply);
# });
# ```
#
# Example: using the callback
#
# ```javascript
# rs.replyAsync(username, msg, this, function(error, reply) {
# console.log("Bot>", reply);
# });
# ```
(the documentation uses GitHub flavored markdown)
Could you add an example to the If not I can add one sometime later after this PR is merged. |
Added some documentation, as per your suggestion. working on a small example now |
I've added an example using replyAsync in eg/reply-async ☔ |
…ises Feature/subroutines with promises
This adds support for async subRoutines through replyAsync as discussed in #77 ⚡