Created
October 27, 2018 13:51
-
-
Save productioncoder/0b4e85bf1842e4a933de782b349b7c5d to your computer and use it in GitHub Desktop.
Youtube ignore promise failure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function ignoreErrors(fn, ...args) { | |
return () => { | |
const ignoreErrorCallback = (response) => response; | |
return fn(...args).then(ignoreErrorCallback, ignoreErrorCallback); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment