Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: check for and return promise instead of awaiting (#2586)
There are some checks in `SvelteDocument` where we do the work once in case it hasn't started yet. But we're potentially doing the work more often than necessary, because we're awaiting the result before assigning it to the "chache" and returning it. That way, if another request would come in while the promise isn't resolve yet, we would kick off another needless compile. This fixes that by assigning the promise to the "cache" instead.
- Loading branch information