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.

reducer.js 566B

1234567891011121314151617181920212223
  1. // @flow
  2. import { ReducerRegistry, set } from '../../base/redux';
  3. import {
  4. INCOMING_CALL_ANSWERED,
  5. INCOMING_CALL_DECLINED,
  6. INCOMING_CALL_RECEIVED
  7. } from './actionTypes';
  8. ReducerRegistry.register(
  9. 'features/mobile/incoming-call', (state = {}, action) => {
  10. switch (action.type) {
  11. case INCOMING_CALL_ANSWERED:
  12. case INCOMING_CALL_DECLINED:
  13. return set(state, 'caller', undefined);
  14. case INCOMING_CALL_RECEIVED:
  15. return set(state, 'caller', action.caller);
  16. }
  17. return state;
  18. });