( powerSync: PowerSyncDatabase, )
| 36 | }; |
| 37 | |
| 38 | const summarizeBatch = async ( |
| 39 | powerSync: PowerSyncDatabase, |
| 40 | ): Promise<[CrudSummary[], (() => Promise<void>)?]> => { |
| 41 | const batch = await powerSync.getCrudBatch(); |
| 42 | return [ |
| 43 | batch?.crud.map(({op, table, id, opData}) => ({ |
| 44 | op, |
| 45 | table, |
| 46 | id, |
| 47 | opData, |
| 48 | })) ?? [], |
| 49 | batch?.complete, |
| 50 | ]; |
| 51 | }; |
| 52 | |
| 53 | const completeNextBatch = async (powerSync: PowerSyncDatabase) => |
| 54 | (await summarizeBatch(powerSync))[1]?.(); |
no outgoing calls
no test coverage detected
searching dependent graphs…