constructor()

in fusion-plugin-react-redux/src/browser.js [46:85]


        constructor(ctx) {
          if (storeCache) {
            // $FlowFixMe
            this.store = storeCache;
          } else {
            // We only use initialState for client-side hydration
            // The real initial state should be derived from the reducer and the @@INIT action
            if (!preloadedState) {
              const stateElement = document.getElementById('__REDUX_STATE__');
              if (stateElement) {
                preloadedState = deserialize(
                  unescape(stateElement.textContent)
                );
              }
            }
            const devTool =
              reduxDevToolsConfig !== false &&
              __DEV__ &&
              window.__REDUX_DEVTOOLS_EXTENSION__ &&
              // $FlowFixMe
              __REDUX_DEVTOOLS_EXTENSION__({
                trace: true,
                traceLimit: 25,
                ...((typeof reduxDevToolsConfig === 'object' &&
                  reduxDevToolsConfig) ||
                  {}),
              });
            const enhancers = [enhancer, ctxEnhancer(ctx), devTool].filter(
              Boolean
            );
            // $FlowFixMe
            this.store = createStore(
              reducer,
              preloadedState,
              // $FlowFixMe
              compose(...enhancers)
            );
            storeCache = this.store;
          }
        }