# Function customReducer

- customReducer<T>(
  defaultValue: T,
  merge: (existing: T, incoming: T) => T,
  ): StateFieldSchema<T>

  Creates a custom reducer with a merge function.

  #### Type Parameters

  - T

  #### Parameters

  - defaultValue: T
  - merge: (existing: T, incoming: T) => T

  #### Returns StateFieldSchema<T>

  - Defined in packages/nexus-agents/src/orchestration/graph/graph-builder.ts:325