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 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. });