I had created a util .js file that calling rest api's, and I need to communicate between this util (not a component) and other components.
For example, when doing login if it fails to raise an event that Login component will catch and act accordingly.
Not sure if it's the right approach (I'm new to react), how it can be done?
I implemented a flux solution (despite a redux appraoch could be enough and one store -which is the rest service- can do the work)
Dispatcher:
RestService (store):
Actions :
Login component: