anvilistas / anvil-labs

MIT License
9 stars 3 forks source link

SW: bg sync with fallback #146

Closed s-cork closed 12 months ago

s-cork commented 12 months ago

Adds fallback support for background sync backwards incompatible

rather than doing


@sync_event_handler
def on_sync(e):
    if e.tag != "my_tag":
        return

self.onsync = on_sync

instead do


def on_sync():
    ...

self.BackgroundSync("my_tag", on_sync)
s-cork commented 12 months ago

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

s-cork commented 12 months ago

@rhurlbatt - any questions before merging?

Rick-VIPER commented 12 months ago

@s-cork no we are good. Production is still running on the Web Worker so this shouldnt break anything for us. Thanks for checking.

meatballs commented 12 months ago

Any chance of a few words on how to use it so I can try things out?

s-cork commented 12 months ago

Here's the diff for the demo app: https://github.com/anvilistas/service-worker-demo/pull/1

Otherwise everything else remains the same