Guest User

Untitled

a guest
Jan 18th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. /**
  2. * Created by vd on 10/01/18.
  3. */
  4. 'use strict';
  5. const Promise = require('bluebird');
  6.  
  7. async function demoAsyncFun() {
  8. return Promise.resolve([1,2,3]);
  9. }
  10.  
  11. //demoAsyncFun().map(console); //map is not a function
  12. Promise.method(demoAsyncFun)().map(console.log);
  13.  
  14. //or
  15. Promise.resolve(demoAsyncFun()).map(console.log);
Add Comment
Please, Sign In to add comment