syncQueueManager
registerSyncProcessor
Registers a processor function for the sync queue for a specific store key. The processor function is called when the sync queue is triggered. The processor function is called with no arguments and is expected to return a promise that resolves if the sync was successful and rejects if the sync failed. If a processor function is already registered for the given store key, the old function is replaced with the new one.
Parameters:
storeKey: - The key identifying the specific store queue.processor: - The processor function to be called when the sync queue is triggered.
triggerAllProcessors (async)
Triggers all registered sync processors. If the device is offline, the function does nothing. If any processor fails or returns 'partial', the function stops further processing and shows an error message. If all processors succeed, the function shows a success message and clears the pending sync tasks flag. The function sorts the processors in the order of 'signInGuests' first, then the rest in the order they were registered.
Returns:
- promise that resolves when all processors have been triggered, or rejects if any processor fails.
