[**Documentation**](../../../README)

***

[Documentation](../../../README) / [zerotal](../../README) / [index](../README) / NextFn

# Type Alias: NextFn

> **NextFn** = () => `Promise`\<`Response` \| `void`\>

Defined in: [packages/core/src/pipeline/types.ts:16](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/core/src/pipeline/types.ts#L16)

Passes control to the rest of the pipeline and resolves with the `Response`
produced downstream (or `undefined` when nothing deeper has set one yet —
the controller may not have run, or a deeper pipe short-circuited with void).

Always guard the result before touching it:

  const res = await next();
  if (res) res.headers.get('…');   // res is Response | undefined

## Returns

`Promise`\<`Response` \| `void`\>
