RefreshDeps ​
useRequest
provides an options.refreshDeps
,Instead of watch
, it will listen for changes in responsive values and reissue requests when the values change .
remark
When the automatic, mode manual
is not true
and refreshDeps will take effect.
Manual collection of dependencies ​
When refreshDeps
passes in an array of responsive objects, when its value changes, the request will be retriggered.
Automatically collect dependencies ​
When refreshDeps
is passed in true
, useRequest
will automatically collect the response object parameters in the function parameters, as long as the response object in the parameters changes, it will carry the latest value to re-initiate the request.
API ​
Options ​
Property | Description | Type | Default |
---|---|---|---|
refreshDeps |
| boolean | WatchSource[] | - |