You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Brian Cavalier edited this page Aug 13, 2017
·
3 revisions
Retry a stream up to N times after failures.
import{throwError,recoverWith}from'most'// retry :: number -> Stream a -> Stream a// return a stream that retries the behavior of the input// stream up to n times after errors. n must be >= 0.// When n === 0, the returned stream will be indistinguishable// from the input stream.constretry=(n,stream)=>recoverWith(e=>n<=0 ? throwError(e) : retry(n-1,stream),stream)