I don't see how generators would change anything here. "with effects", "stateful", and the integration between the two are all equally important in the statement.
Well generators are a good primitive to represent "stateful" "functions" "with effects". The concept of hooks, which somehow give the control back to React to do something, map marvelously to react.
I'd be surprised if generators didn't come into React at one point or another
lhorie|5 years ago
hombre_fatal|5 years ago
dcre|5 years ago
orange8|5 years ago
"stateful": A function that has state, i.e. can store data
"with effects": A function that modifies data outside its own scope
Normal JS functions (as opposed to arrow function) already do this:
function foo(){};
foo.state = bar;
Generator functions take it a step further, where the function remembers internal state between calls.
williamdclt|5 years ago
I'd be surprised if generators didn't come into React at one point or another
traderjane|5 years ago