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

Consider going two-sided. :-) #7

Open
mikelehen opened this issue Apr 8, 2014 · 1 comment
Open

Consider going two-sided. :-) #7

mikelehen opened this issue Apr 8, 2014 · 1 comment

Comments

@mikelehen
Copy link

The reference is great, but it'd be cool to have some minimal examples as well. You can't do that with the current space, but if you went two-sided you could. And we might as well put something useful on the other side anyway. :-) For example:

Writing Data

var ref = new Firebase('https://YOUR.firebaseio.com/');
ref.child('status').set('groovy');

Reading Data

ref.child('status').on('value', function(snapshot) {
   console.log(snapshot.val()); // "groovy"
});

Appending Items to a List

var msgsRef = new Firebase('https://YOUR.firebaseio.com/messages');
msgsRef.push('hey guys!');

Reading a List

msgsRef.on('child_added', function(childSnapshot) {
  console.log(childSnapshot.val()); // 'hey guys!'
});
msgsRef.on(child_removed', function(childSnapshot) { ... }
msgsRef.on(child_changed', function(childSnapshot) { ... }
@asciimike
Copy link
Owner

So I like this idea. The original goal was that I wanted to try and keep it to one page, so it would be a simple API reference guide, rather than the worked out examples that are available on firebase.com/docs. That being said, it may turn out to be a better idea to make it more example focused rather than API focused, since it shows more practical usage.

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