rosshinkley / nightmare-examples

Examples and supplementary documentation for Nightmare
251 stars 46 forks source link

add common pitfall: iteration + asynchrony #2

Closed rosshinkley closed 8 years ago

Mr0grog commented 8 years ago

A slightly more basic formulation of this: queueing new actions after calling run or then. Maybe good to start there (easier to see why things go awry) and then show how loops are an easy way to accidentally do that?

rosshinkley commented 8 years ago

That's a good idea. Because I had seen several questions crop up that amounted to a for-loop that used a single Nightmare instance, it was the most prevalent in my mind when I wrote this issue.

Mr0grog commented 8 years ago

I had seen several questions crop up that amounted to a for-loop that used a single Nightmare instance

Oh, totally. While it’s not the most basic way to show the core problem, I think it’s unquestionably the most common way people get themselves into the situation, so it should definitely be specifically covered.