examples/bin/old/promises-example.js
function(callback) {
  // Asynchronously set our name and status message using promises
  Promise.join(
    tox.setNameAsync('Bluebird'),
    tox.setStatusMessageAsync('Some status message')
  ).then(function() {
    console.log('Successfully set name and status message!');
    callback();
  }).catch(function(err) {
    console.error('Error (initSelf):', err);
    callback(err);
  });
}
function(callback) {
  // Asynchronously set our name and status message using promises
  Promise.join(
    tox.setNameAsync('Bluebird'),
    tox.setStatusMessageAsync('Some status message')
  ).then(function() {
    console.log('Successfully set name and status message!');
    callback();
  }).catch(function(err) {
    console.error('Error (initSelf):', err);
    callback(err);
  });
}
function ( callback ) { // Asynchronously set our name and status message using promises Promise . join ( tox . setNameAsync ( 'Bluebird' ) , tox . setStatusMessageAsync ( 'Some status message' ) ) . then ( function ( ) { console . log ( 'Successfully set name and status message!' ) ; callback ( ) ; } ) . catch ( function ( err ) { console . error ( 'Error (initSelf):' , err ) ; callback ( err ) ; } ) ; }
Initialize ourself. Sets name and status message.
@private
Initialize ourself . Sets name and status message .