* Add a new interceptor to the stack * * @param {Function} fulfilled The function to handle `then` for a `Promise` * @param {Function} rejected The function to handle `reject` for a `Promise` * @param {Object} options The options for the interceptor, synchronous and runWhen * * @re
(fulfilled, rejected, options)
| 17 | * @return {Number} An ID used to remove interceptor later |
| 18 | */ |
| 19 | use(fulfilled, rejected, options) { |
| 20 | this.handlers.push({ |
| 21 | fulfilled, |
| 22 | rejected, |
| 23 | synchronous: options ? options.synchronous : false, |
| 24 | runWhen: options ? options.runWhen : null, |
| 25 | }); |
| 26 | return this.handlers.length - 1; |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Remove an interceptor from the stack |
no outgoing calls
no test coverage detected