Examples for Redux-Offline
cd server-json
npm install
npm start
cd simple-web
npm install
npm start
cd apollo-web
npm install
npm start
Examples for Redux-Offline
Examples for Redux-Offline
cd server-json
npm install
npm start
cd simple-web
npm install
npm start
cd apollo-web
npm install
npm start
For some reason as I was checking https://apollo-web-lohecdnuxh.now.sh (in parallel between my phone and my laptop and temporarily adding todos from phone while offline), my laptop browser gets stuck seeing old data (only 2 todos visible):
If I open a private browsing session in same browser, then I see all the 4 todos that there are currently in this demo:
I'm having a bit of an issue whereby upon firing a login mutation 'data' returns a user token. The token should then be stored via an action call, and the user is then redirected to the main site.
But the token action and the redirect are not acted upon, and the action to complete a user login simply continues to cycle round over and over (See image).
What is the issue here?
store.js
effect: (effect, action) => {
switch (effect.type) {
case 'query':
return client.query({...effect}).then(({data}) => data);
case 'mutation':
return client.mutate({...effect})
.then(({data}) => {
store.dispatch(authToken(data.signinUser.token));
this.context.router.history.push('/');
});
default:
}
}
I tried to open the website while offline, after having opened it while online, but the page doesn't load. Tested on iPhone safari. iOS 10.3.1.
If you create a todo item while offline, whatever mutation you apply to edit does not trigger. This is understandable as it has no ID yet and following mutation won't work.
I know this is just a proof-of-concept, but do you have any ideas how to approach this problem? I'm toying around with doing an offline-first Apllo RN app so basically just started googling offline-support 20min ago. Haven't thought about it much myself, I might have a play around in the next few days.
.. Also, related, if you you crazy tick/untick the checkbox whilst offline, you'll have a myriad of queued requests. Might be two problems to solve at the same time, or it might not. ๐คทโโ๏ธ
Added todo item should be not have been added (or added and instantly removed)
Said todo item is in place
Same thing with any mutation. I.e. add item while offline -> update to checked -> go online -> refresh page
It would be great if you could share a deployment of the Apollo example to see how it behaves. Maybe use https://deploy.now.sh?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.