I'm implementing a cache for the native fetch, and using the latest ReactJS. I was wondering if there was a way to have a global provider or something like that where if a URL exists, just return with the cached data, or if it doesn't, make the call. I dont want to use redux because i dont care about state changes, nor do I want to use local/session storage as well, as i do not want to persist on page refreshed. So I was wondering how I could go about doing this?
I would like to import my Fetch wrapper from anywhere in the application and the fetch wrapper calls the cache to check if the call was made. So for the cache i was hoping for it to be a some global component or provider.