| 192 | } |
| 193 | |
| 194 | start(promiseFn: () => Promise<T>) { |
| 195 | if ("AbortController" in globalScope) { |
| 196 | this.abortController.abort() |
| 197 | this.abortController = new globalScope.AbortController!() |
| 198 | } |
| 199 | this.counter++ |
| 200 | return (this.promise = new Promise((resolve, reject) => { |
| 201 | if (!this.mounted) return |
| 202 | const executor = () => promiseFn().then(resolve, reject) |
| 203 | this.dispatch({ type: ActionTypes.start, payload: executor, meta: this.getMeta() }) |
| 204 | })) |
| 205 | } |
| 206 | |
| 207 | load() { |
| 208 | const promise = this.props.promise |