promisen.js
function writeCache(result) {
          result = memo[hash] = resolve(result);
          if (expire) {
            // cancel previous timer
            if (timers[hash]) clearTimeout(timers[hash]);
            // add new timer
            timers[hash] = setTimeout(clearCache, expire);
          }
          return result;
        }
function writeCache(result) {
          result = memo[hash] = resolve(result);
          if (expire) {
            // cancel previous timer
            if (timers[hash]) clearTimeout(timers[hash]);
            // add new timer
            timers[hash] = setTimeout(clearCache, expire);
          }
          return result;
        }
function writeCache ( result ) { result = memo [ hash ] = resolve ( result ) ; if ( expire ) { // cancel previous timer if ( timers [ hash ] ) clearTimeout ( timers [ hash ] ) ; // add new timer timers [ hash ] = setTimeout ( clearCache , expire ) ; } return result ; }
write new result to cache
write new result to cache