如何给予一类型createAsyyncthunk

代码示例

0
0

如何给予一类型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.

类似页面

带有示例的类似页面

其他语言

此页面有其他语言版本

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