InvitationObserverEffects.swift 871 B

12345678910111213141516171819202122232425262728
  1. //
  2. // InvitationObserverEffects.swift
  3. // Pods
  4. //
  5. // Created by janejntang on 2024/11/21.
  6. //
  7. import Combine
  8. class InvitationObserverEffects: Effects {
  9. typealias Environment = ServiceCenter
  10. let playCallingBellAndVibration = Effect<Environment>.nonDispatching { actions, environment in
  11. actions
  12. .wasCreated(from: InvitationObserverActions.playCallingBellAndVibration)
  13. .sink { action in
  14. InvitationObserverService.shared.playCallingBellAndVibration()
  15. }
  16. }
  17. let stopCallingBellAndVibration = Effect<Environment>.nonDispatching { actions, environment in
  18. actions
  19. .wasCreated(from: InvitationObserverActions.stopCallingBellAndVibration)
  20. .sink { action in
  21. InvitationObserverService.shared.stopCallingBellAndVibration()
  22. }
  23. }
  24. }