# useMemo and useCallback

## Syntax

```javascript
const memoValue = useMemo(callback, optionalArgumentList);
```

Where :

1. `memoValue` : Return memorized by useMemo.
2. `callback`: Function that is executed one or more times according to `optionalArgumentList`.
3. `optionalArgumentList`: Array of arguments that controls the execution of `callback`, if an argument of `optionalArgumentList` changes it will trigger that `callback` is executed again.

## useCallback

Hook that allows you to memorize a callback so that it keeps its scope

```javascript
const memoCallback = useCallack(callback, optionalArgumentList);
```

Where:

1. `memoCallback` : Return memorized by useCallback.


---

# 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://atomico.gitbook.io/doc/api/hooks/usememo-y-usecallback.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.
