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

Methods should be chainable #10

Closed
manthanhd opened this issue Oct 28, 2016 · 3 comments
Closed

Methods should be chainable #10

manthanhd opened this issue Oct 28, 2016 · 3 comments

Comments

@manthanhd
Copy link
Owner

// proposed
new Bot().train(topic, sentence).addSkill(skill).resolve(....)

// current
var bot = new Bot();
bot.train(topic, sentence);
bot.addSkill(skill);
bot.resolve(....);
@rafaelklaessen
Copy link

rafaelklaessen commented Oct 29, 2016

Isn't it just enough to add return this; in each method? It will return the original Bot object so that all other methods are still defined.

@manthanhd
Copy link
Owner Author

@rafaelklaessen you are right. See pull request #17 for updates.

manthanhd added a commit that referenced this issue Nov 2, 2016
Bot.js - Support for Chaining Methods #10
@manthanhd
Copy link
Owner Author

Closing as @marekhakala's merge request has been merged.

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

2 participants