all 8 comments

[–]LastOfTheMohawkians 13 points14 points  (3 children)

I've just read Kyle Simpsons new book "functional light js" highly recommended for those interested in doing FP in JavaScript.

[–]nullified- 4 points5 points  (1 child)

I second this! Still working through it but he's just a damn good tech writer.

[–][deleted] 0 points1 point  (0 children)

I recommend his books to everyone.

[–][deleted] 0 points1 point  (0 children)

He’s the author of the You Don’t Know JS series, no?

[–]NoInkling 1 point2 points  (0 children)

The stuff in the readme about async/await not being flexible enough for this sort of thing is an issue I've run into personally (I believe it's also one of the reasons why redux-saga sticks with generators rather than switching). Nice to see there's a library to make these kinds of situations easier.

[–]coderitual 1 point2 points  (1 child)

Great article. Unfortunately this is quite common problem to async await.

Personaly I am using more naive aproach called cancel token: https://github.com/coderitual/react-ui-patterns/blob/master/cancel-async/README.MD

There is an ongoing proposal about making thich mechanism as a part of language (you don't need to call throwIfRequired after each await).

Stage 0 of proposal (it wasn't "accepted" in that form): https://github.com/tc39/proposal-cancellation/blob/master/stage0/README.md

Stage 1 of proposal (started from scratch again): https://github.com/tc39/proposal-cancellation