Echo JS 0.11.0

<~>
xat 2488 days ago. link 5 points
So, if I understand it correctly, the suspending stuff basically boils down to:

If you throw a promise in your render method then React will abort rendering that component, wait for that promise to fulfill and then render the component again.

And the createFetcher is a helper around this which prevents the promise from being thrown again a second time.

Catching the promise is probably done with the help of error bounderies.

Replies

davidchase 2488 days ago. link 1 point
pretty much, from Andrew Clark:

Here's how suspending works:

- in the render method, read a value from the cache.
- if the value is already cached, the render continues like normal
- if the value is not already cached, the cache *throws a promise*
- when the promise resolves, React retries where it left off

the feed:
https://twitter.com/acdlite/status/969171217356746752