So if I understand it correctly, anything after this line inside the render...
const movie = movieDeatailsFetch.read(props.id);
...
... will block rendering and will defer to a parent component to render instead?
Interesting magic I'd say, since I wouldn't expect such a line to block my rendering.
Wouldn't it be a more "React way" to have HOC component or a render prop that would work exactly like this .read() API?
{movie => }
...
Then this HOC component doesn't need to have the IO-logic in the render, it can put it in the `componentWillMount` or inside another lifecycle method of React.
What's the advantage of putting the IO operation in the render instead of inside a lifecycle method?
Also, how's race-conditioning done? Does the fetcher library have the logic to only render the last fetcher, or is it more complicated than that?
There's lots of magic, especially in the IO part, and would've loved if he went more into detail on how it's actually done - it's a JS-conf afterall.
Also, a fetch()-promise-based API is not the only type of IO-interface we have. In fact it's only one of many.
HTTP2 for instance is on the horizon offering more complex interfaces with open connections possibly returning several results like websockets - on the other hand a Promise only returns one result and then dies. Observables might be a more interesting abstraction for IO-kind of things.
Also, testing this seems rather complex since the render is effectively doing a side-effect.
In any case, cool lateral thinking and I love hearing these type of talks about cool new futuristic stuff rather than some boring old thing everybody knows about.