DEV Community

Discussion on: What the... generators!

Collapse
 
kiho profile image
Kiho Chang

I really like to use generator in my project but debugging is real problem here.
I can't go beyond redux-saga which I have to use in my company project this time, any suggestion?

Collapse
 
genta profile image
Fabio Russo

You can use the .throw() method by calling the generator.

Make It an instanceof Error.
If there’s s an error the generator will stop the execution, by propagating the call to the next .throw() method.