# ResultCallback

## `ResultCallback<Value, Payload>`

Represents a **callback function** with parameters, the [`value`](#value-value) that has been checked, the [`result`](#result-boolean) of this check, and an optional [`payload`](#payload-payload).

{% code title="result-callback.type.ts" %}

```typescript
type ResultCallback<Value = any, Payload = object> = (
  result: boolean,
  value: Value,
  payload?: Payload
) => boolean;
```

{% endcode %}

### Generic type variables

#### <mark style="color:green;">`Value`</mark>`=`<mark style="color:green;">`any`</mark>

A generic type variable `Value` determines [`value`](#value-any) parameter type, by default [`any`](https://www.typescriptlang.org/docs/handbook/basic-types.html#any).

#### <mark style="color:green;">`Payload`</mark>`=`<mark style="color:green;">`object`</mark>

Generic type variable `Payload` indicates [`payload`](#payload-payload) parameter type, by default [`object`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object).

### Parameters

#### `result: boolean`

The check result of a [`boolean`](https://www.typescriptlang.org/docs/handbook/basic-types.html#boolean) type of the given [`value`](#value-value).

#### `value: Value`

The value of the generic type variable [`Value`](#value-any) to check and which the given check [`result`](#result-boolean) applies.

#### `payload?: Payload`

An optional [`object`](https://www.typescriptlang.org/docs/handbook/basic-types.html#object) of a generic type variable [`Payload`](#payload-object) to provide more data.

### Returns

The **return value** is a [`boolean`](https://www.typescriptlang.org/docs/handbook/basic-types.html#boolean) indicating the check result of the given [`value`](#value-value).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://type.angular-package.dev/type/resultcallback.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
