3 ms·
Is this just using generators to allow things to be interrupted and scheduled? Or is it more fancy than that?
by rubyn00bie 7y ago
Is this just using generators to allow things to be interrupted and scheduled? Or is it more fancy than that?
- aocenas 7y agoLast time I seen an explanation for this, they were talking about throwing and catching promises. So you could probably implement suspense with an error boundary just checking if the error you got is actually promise and if so wait for it to resolve until rerendering. But reading this I think there is a bit more to it and I would assume for some things to work you have to actually try rerendering on some scheduler not just wait for promises to resolve (like they mention in how multiple Suspense components are aligned and rendered together if they resolve in close succession)
- bnjmn 7y agoHere's a comment from Sebastian M (React core team member) about why they chose not to use generator functions: https://github.com/facebook/react/issues/7942#issuecomment-254987818 https://github.com/facebook/react/issues/7942#issuecomment-2...