Cómo dar un tipo de createAsyyncthunk

Ejemplos de código

0
0

cómo dar un tipo de createAsyyncthunk

createAsyncThunk<param1,param2,param3>

the first type-parameter
to tell what type will be returned as a result.

The second type-parameter in `createAsyncThunk`
 tells what argument takes the function inside:
 
 The third type-parameter is an object with:
 `{dispatch?, state?, extra?, rejectValue?}`` fields.

`extra` is useful when we need to pass 
 some static data to the request function,
 like jwt-token or HTTP-headers.

 `rejectValue` is useful when we need to type 
 possible errors.

Páginas relacionadas

Páginas de ejemplo relacionadas

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................