Closed amaury1093 closed 4 years ago
Your code needs to await for the cache to restore data: https://github.com/aerogear/offix/blob/master/examples/react/src/index.js#L16
There is possibility to use synchronous api thanks to Apollo-Cache-Persist but we do not recommend or document this use case.
Feature Request
Let's imagine a simple scenario, where I can of/off a toggle (where
isOn
is a boolean).Repro:
isOn = false
at startisOn
becomestrue
, it gets updated on backendExpected:
isOn = true
Actual:
isOn = false
for ~1s, and once the MY_QUERY query resolves, it showsisOn = true
Is your feature request related to a problem? Please describe.
I'd like to remove the small delay of fetching query at startup.
Describe the solution you'd like
Possibly persist all apollo client cache inside AsyncStorage?
Describe alternatives you've considered**
I'm using https://github.com/apollographql/apollo-cache-persist right now. It works, but I was wondering if there's a plan to directly integrate that inside offix?