Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by vd on 10/01/18.
- */
- 'use strict';
- const Promise = require('bluebird');
- async function demoAsyncFun() {
- return Promise.resolve([1,2,3]);
- }
- //demoAsyncFun().map(console); //map is not a function
- Promise.method(demoAsyncFun)().map(console.log);
- //or
- Promise.resolve(demoAsyncFun()).map(console.log);
Add Comment
Please, Sign In to add comment