(
params: InsertMutationFnParams<T, TKey, LocalOnlyCollectionUtils>,
)
| 193 | * Wraps the user's onInsert handler to also confirm the transaction immediately |
| 194 | */ |
| 195 | const wrappedOnInsert = async ( |
| 196 | params: InsertMutationFnParams<T, TKey, LocalOnlyCollectionUtils>, |
| 197 | ) => { |
| 198 | // Call user handler first if provided |
| 199 | let handlerResult |
| 200 | if (onInsert) { |
| 201 | handlerResult = (await onInsert(params)) ?? {} |
| 202 | } |
| 203 | |
| 204 | // Then synchronously confirm the transaction by looping through mutations |
| 205 | syncResult.confirmOperationsSync(params.transaction.mutations) |
| 206 | |
| 207 | return handlerResult |
| 208 | } |
| 209 | |
| 210 | /** |
| 211 | * Wrapper for onUpdate handler that also confirms the transaction immediately |
nothing calls this directly
no outgoing calls
no test coverage detected