09. Parallel Preloading
The Problem
Several screens may be known in advance and should be downloaded together before the user reaches them.
The React Difficulty
React's dynamic imports can be prefetched, but applications generally have to decide how and when to orchestrate those imports.
React Approach
const salesPromise = import("./Sales");
const inventoryPromise = import("./Inventory");
const reportsPromise = import("./Reports");
await Promise.all([salesPromise, inventoryPromise, reportsPromise]);
MS Approach
ManySet provides a direct runtime-oriented approach for this recurring business-application task.
const refs = await ms.preload(
"Sales", "Inventory", "Reports"
);
Why this way is useful in business applications :
The comparison is intended to show where ManySet supplies a business-application abstraction around a recurring task, while keeping HTML and JavaScript visible and directly usable.
Key Point :
ManySet reduces the amount of framework-specific composition required for this particular task, without requiring the React/Angular mechanism to be represented as inherently wrong or incapable.