BlocObserver
open class BlocObserver
Bloc监听器
-
全局监听器,可赋值为自定义监听器实现
Declaration
Swift
public nonisolated(unsafe) static var shared: BlocObserver
-
构造函数
Declaration
Swift
public init()
-
监听Bloc实例创建
Declaration
Swift
open func onCreate<State>(bloc: BlocBase<State>) where State : Equatable
-
监听Bloc事件发生
Declaration
Swift
open func onEvent<Event, State>(bloc: Bloc<Event, State>, event: Event) where Event : Equatable, State : Equatable
-
监听Bloc事件转换
Declaration
Swift
open func onTransition<Event, State>(bloc: Bloc<Event, State>, transition: Transition<Event, State>) where Event : Equatable, State : Equatable
-
监听Bloc错误发生
Declaration
Swift
open func onError<State>(bloc: BlocBase<State>, error: Error) where State : Equatable
-
监听Bloc对象关闭
Declaration
Swift
open func onClose<State>(bloc: BlocBase<State>) where State : Equatable
-
记录日志,子类可重写
Declaration
Swift
open func log(_ message: String)