Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

middleware.js 685B

12345678910111213141516171819202122232425262728293031
  1. import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
  2. import { MiddlewareRegistry } from '../base/redux';
  3. import { SET_BILLING_ID } from './actionTypes';
  4. import { countEndpoint } from './actions';
  5. import { setBillingId } from './functions';
  6. /**
  7. * The redux middleware for billing counter.
  8. *
  9. * @param {Store} store - The redux store.
  10. * @returns {Function}
  11. */
  12. MiddlewareRegistry.register(store => next => async action => {
  13. switch (action.type) {
  14. case SET_BILLING_ID: {
  15. setBillingId(action.value);
  16. break;
  17. }
  18. case CONFERENCE_JOINED: {
  19. store.dispatch(countEndpoint());
  20. break;
  21. }
  22. }
  23. return next(action);
  24. });