Typography

活版印字


  • Home
  • Archive
  • Categories
  • Tags
  •  

© 2020 alincode

Theme Typography by Makito

Proudly published with Hexo

小技巧 - Promise 與 lodash.map 結合運用

Posted at 2017-09-05 lodash Promise.all map 

1
2
3
4
5
6
7
let notifications = await Promise.all(_.map(members, member => {
return Models.Notification.createAsync({
nType: 'MESSAGE_CREATE',
receiver: member.user,
message: 'Hello World'
});
}));

Share 

 Previous post: Laravel 整合 JWT Next post: 複製 UAT 的資料庫,並還原到 Local 中 

© 2020 alincode

Theme Typography by Makito

Proudly published with Hexo