Skip to content

Instantly share code, notes, and snippets.

@marekpiechut
Created January 30, 2017 14:38
Show Gist options
  • Save marekpiechut/7323849b5b9c6372f9fe39d73d3e91fe to your computer and use it in GitHub Desktop.
Save marekpiechut/7323849b5b9c6372f9fe39d73d3e91fe to your computer and use it in GitHub Desktop.
Usage of simple-circuit-breaker
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