Re:Beyond React 16 by Dan Ambramov – Async Rendering and Rea...
by pault on Thursday March 01, 2018 @03:38PM
(#16496036)
Wow, I never would have considered throwing anything other than an Error. On the face of it, this seems like an incredibly powerful technique, but is it an abuse of a language feature?
[ Parent
| on HN ]
Re:Beyond React 16 by Dan Ambramov – Async Rendering and Rea...
by riquito on Thursday March 01, 2018 @03:51PM
(#16496194)
Is a feature of the exceptions to let you handle exceptional cases far away from the caller, up in the stack.
You should keep a distinction between exceptions that means "error" and exceptions that means "some kind of event happened", and handle them accordingly.
Re:Beyond React 16 by Dan Ambramov – Async Rendering and Rea...
by btown on Friday March 02, 2018 @01:19AM
(#16499526)
Python “abuses” exceptions in a similar way every time you iterate over a generator: https://softwareengineering.stackexchange.com/questions/1124...
At the end of the day it’s just a control flow mechanism. And theoretically, if you lack data needed to render, it’s an exceptional condition.
Re:Beyond React 16 by Dan Ambramov – Async Rendering and Rea...
by pault on Saturday March 03, 2018 @02:46PM
(#16511167)
It's a very interesting technique; I will definitely be keeping an eye out for appropriate use cases.
Re:Beyond React 16 by Dan Ambramov – Async Rendering and Rea...
by acjohnson55 on Thursday March 01, 2018 @11:17PM
(#16498973)
My guess is that it won't catch on in the long run. But, you never know.