MCPcopy Create free account
hub / github.com/electric-sql/electric / updateSyncStatus

Function updateSyncStatus

examples/linearlite/src/sync.ts:251–260  ·  view source on GitHub ↗
(newStatus: SyncStatus, message?: string)

Source from the content-addressed store, hash-verified

249}
250
251export function updateSyncStatus(newStatus: SyncStatus, message?: string) {
252 localStorage.setItem(`syncStatus`, JSON.stringify([newStatus, message]))
253 // Fire a storage event on this tab as this doesn't happen automatically
254 window.dispatchEvent(
255 new StorageEvent(`storage`, {
256 key: `syncStatus`,
257 newValue: JSON.stringify([newStatus, message]),
258 })
259 )
260}
261
262export function useSyncStatus() {
263 const currentSyncStatusJson = localStorage.getItem(`syncStatus`)

Callers 2

startSyncToDatabaseFunction · 0.85
doPostInitialSyncFunction · 0.85

Calls 1

setItemMethod · 0.80

Tested by

no test coverage detected