pioneer icon indicating copy to clipboard operation
pioneer copied to clipboard

Extend promises with widget methods.

Open buob opened this issue 11 years ago • 1 comments

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?

buob avatar Feb 24 '15 20:02 buob

:) 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 :+1:

samccone avatar Feb 24 '15 20:02 samccone