examples/conway.js
function connect(orbs, callback) {
  var total = Object.keys(orbs).length,
      finished = 0;

  function done() {
    finished++;
    if (finished >= total) { callback(); }
  }

  for (var name in orbs) {
    orbs[name].connect(done);
  }
}
function connect(orbs, callback) {
  var total = Object.keys(orbs).length,
      finished = 0;

  function done() {
    finished++;
    if (finished >= total) { callback(); }
  }

  for (var name in orbs) {
    orbs[name].connect(done);
  }
}
function connect ( orbs , callback ) { var total = Object . keys ( orbs ) . length , finished = 0 ; function done ( ) { finished ++ ; if ( finished >= total ) { callback ( ) ; } } for ( var name in orbs ) { orbs [ name ] . connect ( done ) ; } }
connects all spheros, triggering callback when done
connects all spheros triggering callback when done