MCPcopy
hub / github.com/axios/axios / use

Method use

lib/core/InterceptorManager.js:19–27  ·  lib/core/InterceptorManager.js::InterceptorManager.use

* 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)

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls

Tested by

no test coverage detected