replaces calls to RSVP.map() with native equivalents. - #9460
Conversation
fe29224 to
2a60e31
Compare
✅ Deploy Preview for ilios-frontend ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for ilios-frontend ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
2a60e31 to
b1dbbf6
Compare
✅ Visual Diff Report — PASSED984 images compared: 984 identical Download the results. |
4aa1510 to
79a9326
Compare
jrjohnson
left a comment
There was a problem hiding this comment.
Would like a slightly different pattern in the routes where we're doing pre-loading to fire all network requests at the same time (as well as resolution in different threads instead of waiting for each individually).
| await term.vocabulary; | ||
| await Promise.all(sessions.map((s) => s.sessionType)); | ||
| return await Promise.all(sessions.map((s) => s.totalSumDuration)); |
There was a problem hiding this comment.
This has slightly different loading behavior in that it would now send each network request individually, waiting for the response. This is repeated in a few of the routes here, a better patten would be something more like:
| await term.vocabulary; | |
| await Promise.all(sessions.map((s) => s.sessionType)); | |
| return await Promise.all(sessions.map((s) => s.totalSumDuration)); | |
| //this is freehanded, not comitable, just an example | |
| return Promise.all([ | |
| term.vocabulary, | |
| ...sessions.map((s) => s.sessionType), | |
| ...sessions.map((s) => s.totalSumDuration), | |
| ]); |
that will fire all the requests at the same time and only move on with rendering when they've all resolved.
There was a problem hiding this comment.
yea makes sense. i'll give the destructuring approach a try. thanks.
79a9326 to
56a6b53
Compare
fixes ilios/ilios#7325