Skip to content
Discussion options

You must be logged in to vote

The reason why certain operations, dynamic data access or Math.random, etc, suspend by default (require a fallback) is exactly what you describe. They are all truly asynchronous work, (in this context not limited to JS async mechanics necessarily), they take an indeterminate time to complete, under which we consider them pending, and might resolve or reject, and/or yield different results every time you call them.

What use cache allows you to do at build time, is to take a snapshot in time of these operations at-the-time-of-build, by actually running them, and paying upfront the time cost, and storing that result into the static shell (even Math.random). Further more you assign a cacheLif…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by charshin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants