1 | var isFunction = require('x-common-utils/isFunction');
|
2 |
|
3 | /**
|
4 | * The function to call `options.onRequestCreated` callback.
|
5 | *
|
6 | * @param {RequestOptions} options The request options.
|
7 | * @param {HttpRequest|JSONPRequest} request The request instance.
|
8 | */
|
9 | function callRequestCreatedCallback(options, request) {
|
10 | var onRequestCreated = options.onRequestCreated;
|
11 |
|
12 | if (isFunction(onRequestCreated)) {
|
13 | onRequestCreated(request);
|
14 | }
|
15 | }
|
16 |
|
17 | module.exports = callRequestCreatedCallback;
|