Created
April 30, 2012 15:05
-
-
Save lightsofapollo/2559076 to your computer and use it in GitHub Desktop.
dsl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//right now you can do this. | |
var device = new Marionette.Client(); | |
device.startSession(function(){ | |
var body, text; | |
device. | |
goUrl('http://google.com', function(){ //result of command }). | |
findElement('body', function(el){ | |
el.text(function(text){ | |
//you have the text | |
}); | |
}); | |
}); | |
//With generators I want to do something like this | |
yield device.startSession(); | |
yield device.goUrl('http://google.com'); | |
//without chaining | |
var body = yield device.findElement('body'); | |
text = yield body.text(); | |
//do stuff with text | |
//with chaining | |
var text = yield device.findElement('body').text(); | |
//do stuff with text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment