Skip to content

Commit

Permalink
more docs for quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
brianleroux committed Jul 18, 2011
1 parent fa7ce8a commit 3fd886a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions doc/initialization.md
Expand Up @@ -5,24 +5,23 @@ You have many options for kicking up a lawnchair.


new Lawnchair(function() {
// default params "records" and "record" in terse callbacks
// default params: records and record in terse callbacks
})


though `new` is something of an overkill for a js constructor and maybe
we want to setup our own parameter names for terse callbacks


// assign lawnchair instance to variable ppl
var ppl = Lawnchair({name:'people', record:'person'}, function(people){
// something to save...
var me = {name:'brian'}
// "this" is bound to the lawnchair instance
// anon fn bound to the instance
this.save({a:1})

// hmm... but "this" won't work inside an anon handler
// hmm... but this won't work inside an anon handler
document.getElementById('btn').addEventListener('click', function(){
// so, you can also refer to a named argument...
Expand Down

0 comments on commit 3fd886a

Please sign in to comment.