MCPcopy Create free account
hub / github.com/async-library/react-async / cancel

Method cancel

packages/react-async/src/Async.tsx:234–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232 }
233
234 cancel() {
235 const onCancel = this.props.onCancel || defaultOptions.onCancel
236 onCancel && onCancel()
237 this.counter++
238 this.abortController.abort()
239 this.mounted && this.dispatch({ type: ActionTypes.cancel, meta: this.getMeta() })
240 }
241
242 onResolve(counter: Number) {
243 return (data: T) => {

Callers 2

componentDidUpdateMethod · 0.95
componentWillUnmountMethod · 0.95

Calls 1

getMetaMethod · 0.95

Tested by

no test coverage detected