Come dare un tipo di createAsyyncthunk

Esempi di codice

0
0

come dare un tipo di 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.

Pagine correlate

Pagine di esempio simili

In altre lingue

Questa pagina è in altre lingue

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