12 lines
276 B
Plaintext
12 lines
276 B
Plaintext
function executeTwoCallbacks(promise, callback, errorCallback) {
|
|
if (typeof callback === 'function') {
|
|
promise.then(callback);
|
|
}
|
|
|
|
if (typeof errorCallback === 'function') {
|
|
promise.catch(errorCallback);
|
|
}
|
|
}
|
|
|
|
export default executeTwoCallbacks;
|