Skip to content

dschom/reactive-caching-exp

Repository files navigation

Fxa Settings Reactivity and Data Fetching / Caching

Here are 4 basic approaches to handling data fetching in FxA. The code tries to go through these approaches and validate that a very simple of example case works. Essentially there is a call to a public graphql api (the results are in German... /shrug), and then there is the ability update the fetched data by typing into a text box. The fetched data isn't then updated on the the server, but rather in the cache / local state only!

This example is applicable to FxA for a couple reasons. First, we have a mix of apollo and rest calls in our application. This means we have to update the apollo cache after we make rest calls, or refetch the data from the server to keep apollos cache up to date. Second, we store data in Apollo's cache, but we also store some data in local storage. There is a small overlap between these two data sets.

Personal Opinions on These Examples

I don't really want to bias any one with my opinions, but I'm going too anyways ;p... so please be critical of my arguments here. After a lot of deliberation, I think example 4 or 3b is the way to go. And I'm sort of thinking we should drop gql support.

About

Just a toy project exploring different caching options and how they impact react's 'reactivity'.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors