P E N C I L
Login
Promise
  1. Support
    1. Mongoose + Es6: mongoose.Promise = Promise;
    2. ES6 babel support Project (ie. there is window.Promise object)
    3. Without ES6
      var Promise= require('bluebird');
  2. Basic use
    1. new Promise((resolve, reject)=> { resolve(x) or rereject(x)});
    2. promise.then((o)=>{}).catch((e)=>{});
    3. then() can return a normal object or a new Promise() for chaining
    4. If there is no waiting, return Promise.resolve(userCache[username]);
  3. Mongoose:
    1. mongoose.Promise = require('bluebird');