Don't return await from async func

This commit is contained in:
Jordan Eldredge 2019-08-18 14:21:24 -07:00
parent 95208d173b
commit 2b4c2dca97
3 changed files with 2 additions and 3 deletions

View file

@ -6,7 +6,6 @@
"no-nested-ternary": "off",
"react-hooks/rules-of-hooks": "off",
"react-hooks/exhaustive-deps": "off",
"no-return-await": "off",
"eqeqeq": "off",
"no-else-return": "off",
"import/no-extraneous-dependencies": "off"

View file

@ -18,7 +18,7 @@ import Text from "./runtime/Text";
import Status from "./runtime/Status";
async function loadImage(imgUrl) {
return await new Promise((resolve, reject) => {
return new Promise((resolve, reject) => {
const img = new Image();
img.addEventListener("load", () => {
resolve(img);

View file

@ -48,7 +48,7 @@ export async function asyncFlatMap(arr, mapper) {
const mapped = await Promise.all(arr.map(mapper));
const childPromises = mapped.map(async item => {
if (Array.isArray(item)) {
return await asyncFlatMap(item, mapper);
return asyncFlatMap(item, mapper);
}
return item;
});