FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

brumm/homemade-suspense · GitHub

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homemade Suspense

This is a toy implementation of Suspense using Error Boundaries. Do not use this in production!

This is using the github API to display a repositories' file tree. Data is fetched 'synchronously' inside the component, in a toy approximation of what the Suspense API is doing.

The idea is to use an ErrorBoundary show a loading state if we catch a promise that is being thrown further down the tree. The promise is thrown if data is not yet fetched (cache miss) and returned synchronously if data is already there (cache hit)

Check out HomemadeSuspense.js and cache.js to see the magic.

Note: you'll have to supply your own API token in resources.js

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL