()
| 205 | } |
| 206 | |
| 207 | load() { |
| 208 | const promise = this.props.promise |
| 209 | const promiseFn = this.props.promiseFn || defaultOptions.promiseFn |
| 210 | if (promise) { |
| 211 | this.start(() => promise) |
| 212 | .then(this.onResolve(this.counter)) |
| 213 | .catch(this.onReject(this.counter)) |
| 214 | } else if (promiseFn) { |
| 215 | const props = { ...defaultOptions, ...this.props } |
| 216 | this.start(() => promiseFn(props, this.abortController)) |
| 217 | .then(this.onResolve(this.counter)) |
| 218 | .catch(this.onReject(this.counter)) |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | run(...args: any[]) { |
| 223 | const deferFn = this.props.deferFn || defaultOptions.deferFn |
no test coverage detected