DEV Community

Discussion on: How YOU can use the Context API in React.js to pubsub

 
softchris profile image
Chris Noring

What I mean is there is obviously the React implementation for Redux. By using the library RxJS we can implement pubsub like so github.com/softchris/Architecting-... and we can probably shorten that to 4-5 lines if we really wanted to.. I find that React is prone to want to solve most things by creating a DSL of components... I prefer when things are more explicit and I can see what's going on. Obviously, the Context API works but it's just one way of many.. Pubsub exist in a lot of libraries across frontend and backend..