Created
May 22, 2012 21:18
-
-
Save iros/2771685 to your computer and use it in GitHub Desktop.
Thoughts on Chaining
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
var el = $('div.button'); | |
// is this bad? I'd think so: | |
el.addClass('closed').css('border', 'none').attr('x', 5); | |
// first method call in line, subsequent below indented? | |
el.addClass('closed') | |
.css('border', 'none'); | |
// context switching adds indentation? (like in d3) | |
var chart = d3.select('ul') | |
.append('ul') | |
.data(myData) | |
.enter() | |
.append('li') | |
.text(function(d) { | |
return d.value; | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Questions: