()
| 138 | } |
| 139 | |
| 140 | export function startCoreCacheSync() { |
| 141 | if (active) { |
| 142 | return stopCoreCacheSync; |
| 143 | } |
| 144 | active = true; |
| 145 | scheduleSync(); |
| 146 | syncTimer = window.setInterval(scheduleSync, CACHE_EXPIRATION); |
| 147 | window.addEventListener("online", scheduleSync); |
| 148 | window.addEventListener(CACHE_CLEARED_EVENT, stopCoreCacheSync); |
| 149 | return stopCoreCacheSync; |
| 150 | } |
| 151 | |
| 152 | export function stopCoreCacheSync() { |
| 153 | active = false; |
no test coverage detected