rocicorp / replicache

Realtime Sync for Any Backend Stack
https://doc.replicache.dev
1.01k stars 37 forks source link

We should hook navigator.online to know when to try and send a push and pull again. #1019

Open aboodman opened 2 years ago

aboodman commented 2 years ago

This is marginally useful in the real world, but during development is very useful. Devs frequently use the "offline" feature when developing or testing and it would be great if Replicache came back right away from being offline when this happened.

arv commented 2 years ago

If we do this we should probably put the logic in ConnectionLoop

We could also potentially only do this in debug mode.

aboodman commented 2 years ago

We could also potentially only do this in debug mode.

It would also help a lot for demos, e.g.., replicache-todo. People frequently disconnect network on their device to test these demos. It will be more satisfying demo if sync happens immediately on reconnect.

aboodman commented 2 years ago

If we do this we should probably put the logic in ConnectionLoop

👍