repos / starfx

a micro-mvc framework for react apps
git clone https://github.com/neurosnap/starfx.git

commit
f18f8d6
parent
5a0fde6
author
Eric Bower
date
2025-06-01 11:10:29 -0400 EDT
docs: preload copy
1 files changed,  +17, -14
M docs/posts/learn.md
+17, -14
 1@@ -77,28 +77,31 @@ page because it should help here.
 2 
 3 # Data strategy: preload then refresh
 4 
 5-Preloading is a first-class citizen in `starfx`. It is the primary use case for
 6-using it.
 7-
 8 The idea is simple:
 9 
10 > Preload most of your API data in the background and refresh it as the user
11 > interacts with your web app.
12 
13+This strategy removes the need to show loaders throughout your app.
14+
15+Preloading is a first-class citizen in `starfx`. It is the primary use case for
16+using it.
17+
18 This is the biggest performance boost to using a single-page app. Since routing
19-happens all client-side, it's beneficial to download data in the background
20-while the user navigates through your web app. While you might be fetching slow
21-API endpoints, it feels instantaneous because the data was preloaded.
22+happens all client-side, it's beneficial to first download data in the
23+background while the user navigates through your web app. While you might be
24+fetching slow API endpoints, it feels instantaneous because the data was already
25+loaded before a pager needed to display it.
26 
27-When the user lands on your web app, initialize a preload thunk that will
28-essentially sync the user's database locally, then when they navigate to a page
29-that requires data, refresh that data as needed.
30+When the user lands on your web app, initialize a preload thunk that will sync
31+the user's database locally, then when they navigate to a page that requires
32+data, refresh that data as needed.
33 
34 For example, let's say the root page `/` requires a list of users while the
35 `/mailboxes` page requires a list of mailboxes.
36 
37-One the root page you would not only fetch the list of users, but you would also
38-fetch the lists of mailboxes. When the user finally decides to click on the
39-"Mailboxes" page, the page will act as if the data was loaded instantly because
40-it was preloaded. So the user sees the data immediately, while at the same time
41-you would also re-fetch the mailboxes.
42+On the root page you would fetch the list of users as well as the lists of
43+mailboxes. When the user finally decides to click on the "Mailboxes" page, the
44+page will act as if the data was loaded instantly because it was preloaded. So
45+the user sees the data immediately, while at the same time you would also
46+re-fetch the mailboxes.