ErrorEffects.swift 454 B

1234567891011121314151617181920
  1. //
  2. // ErrorEffects.swift
  3. // TUIRoomKit
  4. //
  5. // Created by CY zhao on 2024/7/8.
  6. //
  7. import Foundation
  8. class ErrorEffects: Effects {
  9. typealias Environment = ServiceCenter
  10. let throwError = Effect<Environment>.nonDispatching { actions, environment in
  11. actions
  12. .wasCreated(from: ErrorActions.throwError)
  13. .sink { action in
  14. environment.store?.errorSubject.send(action.payload)
  15. }
  16. }
  17. }