3 ms·
> binding domain concerns to each component rather than encouraging presentation components. Quite the opposite. Relay allows you to write proper presentation
by tiglionabbit 10y ago
> binding domain concerns to each component rather than encouraging presentation components.
Quite the opposite. Relay allows you to write proper presentation components and then wrap them in data-provider components. This is a step toward isolation of presentation and data management. If you could move all methods that actually manipulate the data up out of the presentation components and into their wrappers, that's even better.
Unfortunately, the parent component has to reference the wrapper instead of the wrapped component, so you get this alternation between presentation and data management. But at least the leaf nodes can be considered reusable presentation components with no coupling to the data layer.
Anyway, everyone is doing this these days. Check out:
* https://github.com/mobxjs/mobx https://github.com/mobxjs/mobx
* https://github.com/ekosz/atreyu https://github.com/ekosz/atreyu