Created
February 1, 2018 23:20
-
-
Save courtneymyers/b6f63095848dbe6979de03dafee92c62 to your computer and use it in GitHub Desktop.
Higher order function to pass to Promise w/ .catch() to handle errors
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
const handleError = fn => (...params) => fn(...params).catch(err => console.error(err)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment