A route only needs to block (Suspend) on the initial data, right?
If our Route were to preload its data, and also send down a read() method that got called on every render, and threw until the FIRST data were ready, wouldn’t that be sufficient?
1/
But now a single initial page reveal with all needed data. And render as you fetch.
Is there a downside I’m missing?
2/
const TodoList = (props) => {
// data already prefetching
props.res.read(); //throws if init data not ready
const { loading, data } = useSameOldGraphQLQuery(...);
// and go ...
✅ Suspend initial render until all data ready
✅ Incremental spinner
❌ Really long wait times won’t revert to the <Suspense /> fallback but who cares?
const { loading, data } = useSameOldGraphQLQuery(...);
if you then mutate some local data on the other side of your app, this 👆 hook will re-fire, on its own, automatically, with updated data.
1/
It sees data update, and it pushes updates out of the hook
Ideally without boiling the ocean / re-writing everything.
if you then mutate some local data on the other side of your app/
if you then mutate data from the other side of your app/