Skip to content
Discussion options

You must be logged in to vote

Use loader when you want to load data server-side, use clientLoader when you want to load data client-side.

I think most of the time you should go for loader and load data server-side, you won't have to think about CORS, server-to-server requests are typically faster and with more predictable latency, you could use a server-side cache either per user or shared across users, or use an http cache to cache the whole response to one or all users.

The clientLoader is great for things that are only available client-side (e.g. call navigator.getCurrentLocation or localStorage.getItem).

In your case, for the requirement to show a fallback while the fetch to the API is in progress, you can use defer

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@Gn3po4g
Comment options

@spacepolice10
Comment options

@Gn3po4g
Comment options

Comment options

You must be logged in to vote
2 replies
@Gn3po4g
Comment options

@sergiodxa
Comment options

Answer selected by Gn3po4g
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants