cnodejs / egg-cnode

CNode 社区 Egg 版本
https://cnodejs.org/
MIT License
1.48k stars 285 forks source link

Refactor and optimize `list()` #139

Closed ghost closed 6 years ago

ghost commented 6 years ago

1) Use ES6 syntax to rewrite readMessages/unreadMessages instead of using index for a whole array. 2) Use Promise.all to wrap the mapping from read/unread messages and do Promise.all to await to save time.

codecov[bot] commented 6 years ago

Codecov Report

Merging #139 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #139      +/-   ##
==========================================
+ Coverage   93.26%   93.27%   +<.01%     
==========================================
  Files          48       48              
  Lines        1664     1665       +1     
==========================================
+ Hits         1552     1553       +1     
  Misses        112      112
Impacted Files Coverage Δ
app/controller/api/message.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e634a68...f4db0dd. Read the comment docs.

ghost commented 6 years ago

/cc: @JacksonTian