type LoaderResult = {
awaitable: Promise<unknown>;
rest: Record<string, Promise<unknown>;
}
This tells the component orchestrating route transitions that the awaitable promise needs to be settled before rendering the new route's component, but the rest can be passed verbatim, and let the component itself handle errors and loading state by wrapping them in useFetch.
This is a continuation of https://github.com/hypothesis/lms/pull/6342 and https://github.com/hypothesis/lms/pull/6357, which enhances the route loaders so that, instead of returning a promise, they return an object with this shape:
This tells the component orchestrating route transitions that the
awaitable
promise needs to be settled before rendering the new route's component, but the rest can be passed verbatim, and let the component itself handle errors and loading state by wrapping them inuseFetch
.