react-suspense-redux-cache
Using redux with React suspense to store the cache.
This is a joke! Don't use it! Really! This is just meant to demostrate how easy it is to create cache providers for the new React "Suspense" feature 😅
Examples
Install dependency:
yarn add react-suspense-redux-cache# or npm i react-suspense-redux-cache
And (DONT!) use in your app:
;;;;// ^ really, there are 1000000 gists already, just google it // Add to redux storeconst store = ; // Create data fetcherconst getUsers = ; // User data fetcher in your component { const users = data; return <Fragment> <h1>Example</h1> <ul> users </ul> </Fragment> ; } // Invalidate cachegetUsers; // specific entrygetUsers; // all entries in cache // Renderconst container = document;const root = ReactDOM; root;