News for hackers. Stuff that matters.
Re:Show HN: PouchDB - The JavaScript database that syncs by vog on Monday July 15, 2013 @08:37AM (#6045099)
The example code is somewhat weird:

  var db = new PouchDB('dbname');
  
  db.put({
    _id: '[email protected]',
    name: 'David',
    age: 66
  });
  
  db.changes({
    onChange: function() {
      console.log('Ch-Ch-Changes');
    }
  });
  
  db.replicate.to('http://example.com/mydb');
Shouldn't you set up the event listener before "db.put()"?
Re:Show HN: PouchDB - The JavaScript database that syncs by daleharvey on Monday July 15, 2013 @08:40AM (#6045114)
I mostly just wanted to highlight the key features with 'real' code in the order you would come across them, you are right though might be worth switching that, thanks
Re:Show HN: PouchDB - The JavaScript database that syncs by wodow on Monday July 15, 2013 @08:52AM (#6045172)
You could define two functions to wrap the calls - do_a_put(), do_a_sync() - in that order and then call them in the reversed order in the example?