Consider this code
const response = await fetch(\'\');
const responseJson = await response.json();
responseJson = _.sortBy(responseJson, \"number
I found that I didn't have to put the async / await inside of the Promise.all
wrapper.
Using that knowledge, in conjunction with lodash chain (_.chain
) could result in the following simplified version of the accepted answer:
const responseJson = await Promise.all( _
.chain( response.json() )
.sortBy( 'number' )
.map( json => addEnabledProperty( json ) )
.value()
)