Publish an enviorenment
You'll need to change the env.ENDPOINT value
You can install the app as PWA
then upload some files, add them to IDB, sync them
then repeat but go off-line
close the app
come on line
wait a bit
open the app - either the sync event will fire when you open the app, or it will have already fired while the app was off!
@rhurlbatt - you might want to check out the clone in this PR which uses the features added here
Some instructions above
You might also want to try opening the app in multiple tabs
close #96, close #97, close #98
Managed to find some time last night to look at this
Have a fun working prototype here: https://anvil.works/build#clone:6KH7IIUS22JMNW54=664RQKGADXDEV6KC4XPXNMPR
Publish an enviorenment You'll need to change the env.ENDPOINT value You can install the app as PWA then upload some files, add them to IDB, sync them then repeat but go off-line close the app come on line wait a bit open the app - either the sync event will fire when you open the app, or it will have already fired while the app was off!
API Changes:
add_listener
->subscribe
,remove_listener
->unsubscribe
@self.sync_event_handler
- can be used as a decorator for async
/periodicsync
handler It's similar, but not quite the same as:self.sync_event_handler = sync_event_handler
@self.sync_event_handler def onsync(e):
do a bunch of things when a sync event fires
self.onsync = onsync