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

Extend promises with widget methods. #314

Open
buob opened this issue Feb 24, 2015 · 1 comment
Open

Extend promises with widget methods. #314

buob opened this issue Feb 24, 2015 · 1 comment

Comments

@buob
Copy link

buob commented Feb 24, 2015

so instead of

this.find('.foo').then(function(el) {
  el.find('.bar').then(function(el) {
    el.click('.lee');
  });
});

We could just have

this.find('.foo').find('.bar').click('.lee');

We could do this by adding say a find method that would look basically like this:

this.find = function(args) {
  this.then(function(el) {
    el.find(args);
  });
};

So good or no good?

@samccone
Copy link
Contributor

:) give it a go
There is quite a bit of complexity involved in getting a fluent style api like ^ working, if you want to try to see if you can get it to work, i am totally 👍

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

No branches or pull requests

2 participants