diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2017-09-21 12:49:18 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2017-09-21 12:49:18 -0400 |
| commit | b28028ac4082842143b0f528d6bc539da6ccb419 (patch) | |
| tree | 1e26ea969a781ed8e323fca4e3c76345113fc694 /www/lib/localforage/src/utils/executeTwoCallbacks.js | |
| parent | 676270d21beed31d767a06c89522198c77d5d865 (diff) | |
mega changes, including updates and X
Diffstat (limited to 'www/lib/localforage/src/utils/executeTwoCallbacks.js')
| -rw-r--r-- | www/lib/localforage/src/utils/executeTwoCallbacks.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/www/lib/localforage/src/utils/executeTwoCallbacks.js b/www/lib/localforage/src/utils/executeTwoCallbacks.js new file mode 100644 index 00000000..f98c7585 --- /dev/null +++ b/www/lib/localforage/src/utils/executeTwoCallbacks.js @@ -0,0 +1,11 @@ +function executeTwoCallbacks(promise, callback, errorCallback) { + if (typeof callback === 'function') { + promise.then(callback); + } + + if (typeof errorCallback === 'function') { + promise.catch(errorCallback); + } +} + +export default executeTwoCallbacks; |
