SwoffSwoff

syncWhenPossible

Defer queue drain until online, then process.

syncWhenPossible(options?)

From swoff/mutation/sync.ts. Defers queue drain until navigator.onLine. Processes the queue in FIFO order. Calls processMutationQueue. Listens for online event if offline.

import { syncWhenPossible } from "swoff/mutation/sync";

On this page