You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

middleware.js 590B

12345678910111213141516171819202122232425
  1. import { SET_ROOM } from '../base/conference';
  2. import { MiddlewareRegistry } from '../base/redux';
  3. import { initAnalytics } from './functions';
  4. /**
  5. * Middleware which intercepts config actions to handle evaluating analytics
  6. * config based on the config stored in the store.
  7. *
  8. * @param {Store} store - The redux store.
  9. * @returns {Function}
  10. */
  11. MiddlewareRegistry.register(store => next => action => {
  12. switch (action.type) {
  13. case SET_ROOM: {
  14. const result = next(action);
  15. initAnalytics(store);
  16. return result;
  17. }
  18. }
  19. return next(action);
  20. });