Created
January 30, 2017 14:38
-
-
Save marekpiechut/7323849b5b9c6372f9fe39d73d3e91fe to your computer and use it in GitHub Desktop.
Usage of simple-circuit-breaker
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
function callBackend(url) { | |
return fetch(url) | |
.then(parseResponse) | |
} | |
const withCircuitBreaker = circuitBreaker(callBackend) | |
withCircuitBreaker('http://my.backend.com') | |
.then(doSomethingWithData, handleError) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment