• Get a hash of promises and await them all. Then return the same hash with the resolved values.

    Type Parameters

    Parameters

    Returns Promise<AwaitedPromiseHash<Hash>>

    export async function loader({ request }: LoaderFunctionArgs) {
    return json(
    promiseHash({
    user: getUser(request),
    posts: getPosts(request),
    })
    );
    }
    export async function loader({ request }: LoaderFunctionArgs) {
    return json(
    promiseHash({
    user: getUser(request),
    posts: promiseHash({
    list: getPosts(request),
    comments: promiseHash({
    list: getComments(request),
    likes: getLikes(request),
    }),
    }),
    })
    );
    }