Reputation: 1328
I have use case where I want to use some data from Relay store outside of the react components. So thinking how to get data to some store.
One option would be to put these data to the 'store' in component once component gets the data.
But I would like more to be able create store similar to react component which defines its requirements, but does not render and can be required from any other file.
I thought I could use react component for it, but to instantiate component I need to render it to dom, which does not make sense in this situation.
Any ideas how to achieve that nicely?
Upvotes: 1
Views: 806
Reputation: 4945
If you are dealing with data I suggest you look into using a flux pattern. This would allow you to separate data logic from view logic.
Upvotes: 0