📜 ⬆️ ⬇️

Or meteor

React without Redux, like vodka without beer - money down the drain. If React solves the question "interface - state function", then Redux offers an architecture of data movement in the application. But what a bad luck, what to choose to interact with the backend? In the case of the REST-API, you can pull Fetch, or take a slightly more functional Axios. For WebSocket, there is Socket.io (highly recommended reading ). And what tools can be higher level? Implementing data transport between the front end and backend is not our sadness.


For example, FeatherJS - you can switch within the protocol between REST and SocketIO without changing the client interaction API, there’s just a Redux interface. There is also Apollo and Logux , as two opposites, but they are also united by the Redux interface.


You connect the required React-components to Redux and they jerk as data changes. Requests for such changes also go through the Redux "black box". With all the variety of implementations, we get the same result. Beauty.


And if you recall the isomorphic Meteor (with which I said goodbye a year ago), there are a lot of interesting things: Data Distribution Protocol, Pub / Sub-interaction and MiniMongo on a client with Optimistic Updates. How are things at Meteor now - React is there for a long time, but what about connecting all this to Redux?


Indian developer Abhi Aiyer has published a series of articles on Medium, seemingly having analyzed all possible aspects (as far as I studied the Meteor forum):



Please share your experience using React + Redux in Meteor.


PS Yes, I know about the existence of MobX, I have not applied it in practice, it may even simplify the reactivity magic in Meteor, but so far it seems completely redundant and non-thematic :)


')

Source: https://habr.com/ru/post/334726/


All Articles