MCPcopy Create free account
hub / github.com/TanStack/db / wrappedOnInsert

Function wrappedOnInsert

packages/db-sqlite-persistence-core/src/persisted.ts:2671–2685  ·  view source on GitHub ↗
(
    params: InsertMutationFnParams<T, TKey, TUtils & PersistedCollectionUtils>,
  )

Source from the content-addressed store, hash-verified

2669 )
2670
2671 const wrappedOnInsert = async (
2672 params: InsertMutationFnParams<T, TKey, TUtils & PersistedCollectionUtils>,
2673 ) => {
2674 const handlerResult = localOnlyOptions.onInsert
2675 ? await localOnlyOptions.onInsert(
2676 params as unknown as InsertMutationFnParams<T, TKey, TUtils>,
2677 )
2678 : undefined
2679
2680 await runtime.persistAndConfirmCollectionMutations(
2681 params.transaction.mutations as Array<PendingMutation<T>>,
2682 )
2683
2684 return handlerResult ?? {}
2685 }
2686
2687 const wrappedOnUpdate = async (
2688 params: UpdateMutationFnParams<T, TKey, TUtils & PersistedCollectionUtils>,

Callers

nothing calls this directly

Tested by

no test coverage detected