# All files / composer/utils devtools.js

50% Statements 7/14
50% Branches 4/8
100% Functions 2/2
50% Lines 7/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    348x

    8x

    8x
    14x

    14x

    8x
    46x

     const combinedStores = {};

    // Boot up
    let reduxDevTools;
    Iif (window.__REDUX_DEVTOOLS_EXTENSION__) {
      reduxDevTools = window.__REDUX_DEVTOOLS_EXTENSION__.connect({
        name: 'Buffer Composer'
      });
    }

    const registerStore = (store, initialState) => {
      Iif (reduxDevTools) {
        combinedStores[store] = initialState;
        reduxDevTools.send('@@INIT_' + store.toUpperCase(), combinedStores);
      } else {
        Iif (window.location.href.indexOf('.local') > -1) {
          console.warn('Install the Redux DevTools extension for a better developer experience!');
          console.log('👉 https://github.com/zalmoxisus/redux-devtools-extension')
        }
      }
    };

    const sendToMonitor = (store, action, state) => {
      Iif (reduxDevTools) {
        combinedStores[store] = state;
        reduxDevTools.send(
          { ...action, type: action.actionType },
          combinedStores,
        );
      }
    };

    export { registerStore, sendToMonitor };