Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

middleware.native.js 669B

12345678910111213141516171819202122232425262728
  1. // @flow
  2. import { PARTICIPANT_JOINED, PARTICIPANT_LEFT } from '../base/participants';
  3. import { MiddlewareRegistry } from '../base/redux';
  4. import { updateRemoteParticipants, updateRemoteParticipantsOnLeave } from './functions';
  5. import './subscriber';
  6. /**
  7. * The middleware of the feature Filmstrip.
  8. */
  9. MiddlewareRegistry.register(store => next => action => {
  10. const result = next(action);
  11. switch (action.type) {
  12. case PARTICIPANT_JOINED: {
  13. updateRemoteParticipants(store);
  14. break;
  15. }
  16. case PARTICIPANT_LEFT: {
  17. updateRemoteParticipantsOnLeave(store, action.participant?.id);
  18. break;
  19. }
  20. }
  21. return result;
  22. });