As for Redux to subscribe to events from a component?

As for Redux to subscribe to events from a component?
To design use CREATE-REACT-APP
All the answers found relate to the more simplified structure of the project.
store.subscribe(() => {

But I have a project of this type
The main objective of the subscription to the dispatch type that would actions from different files had no idea about the existence of each other.
EVENT1 and EVENT2 are run from different files, import EVENT2 EVENT1 in the wrong decision, especially stopping dispatch =>
In this arrangement, the project can't find where to subscribe to changes.
For forum made a simplified example
import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import { createStore, applyMiddleware } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import thunk from 'redux-thunk'
import { Router, Route, hashHistory } from 'react-router'
import { syncHistoryWithStore } from 'react-router-redux'
import App from './App'
reducer import from './reducers'
const store = createStore(reducer, composeWithDevTools(applyMiddleware(thunk)));
const history = syncHistoryWithStore(hashHistory, store);
 <provider store="{store}">
 <router history="{history}">
 <route path="/" component="{App}">

export default function reducer1(state = initialState, action) {
 switch (action.type) {
 default: {
 return state;

export const action1 = (data) => dispatch => {
 dispatch({ type: 'EVENT1', payload: {value1:1} })

export const action2 = (data) => dispatch => {
 dispatch({ type: 'EVENT2', payload: {value2:2} })

import * as action1 from './actions/action1';
import * as action2 from './actions/action2';
class App extends Component {
 componentDidMount() {
 this.props.state.reducer1.subscribe( ()=>{
 /*my understanding of the subscription, we have access to EVENT1 and EVENT2*/
 } )
 render() {
 return (<div></div>)
export default connect(
 (state, props, ownProps) => ({
 state: state,
 props: props

but in my case
has such functions like getState() and subscribe()
June 14th 19 at 19:14
2 answers
June 14th 19 at 19:16
I think you need to look in the direction of the middleware and make the wrapper, which cause the desired action

const MyMiddleware = store => next => action => {
 switch(action.type) {
 case 'SOME_EVENT_TYPE': {
 return next(action)
June 14th 19 at 19:18
You took that the wrong way, you have a architectural error. Why subscribe from the component in action? Let action change anything in Redux and store updated data into the component.

Find more questions by tags Redux