gcanti / flow-static-land

[DEPRECATED, please check out fp-ts] Implementation of common algebraic types in JavaScript + Flow
MIT License
408 stars 22 forks source link

Request: Exercise using Aff w/ Canceler #25

Open mwalkerwells opened 7 years ago

mwalkerwells commented 7 years ago

Not coming from a Purescript background, it'd be super useful to see how to use 'Canceler' to invalidate a long-running computations.

I'm having a hard time understanding what is going while looking through source. If you have time—thanks!

jsonnull commented 7 years ago

It looks to me like the Canceler comes into play when you are calling chain with multiple Affs... it seems like if at least one has been canceled, the resulting Aff will be wrapping the Canceler success value.

Let me know if that made any sense at all!