@js-soft/native-common / Exports / CommonEventBus
INativeEventBus
• new CommonEventBus()
• Private
eventBus: EventBus
• Private
locked: boolean
= true
• Private
queue: Event
[] = []
▸ init(): Promise
<Result
<void
, ApplicationError
>>
Promise
<Result
<void
, ApplicationError
>>
INativeEventBus.init
▸ publish(event
): Result
<void
, ApplicationError
>
Name | Type |
---|---|
event |
Event |
Result
<void
, ApplicationError
>
INativeEventBus.publish
▸ subscribe(event
, handler
): Result
<number
, ApplicationError
>
Name | Type |
---|---|
event |
Event |
handler |
(event : any ) => void |
Result
<number
, ApplicationError
>
INativeEventBus.subscribe
▸ subscribeOnce(event
, handler
): Result
<number
, ApplicationError
>
Name | Type |
---|---|
event |
Event |
handler |
(event : any ) => void |
Result
<number
, ApplicationError
>
INativeEventBus.subscribeOnce
▸ unsubscribe(event
, id
): Result
<void
, ApplicationError
>
Name | Type |
---|---|
event |
Event |
id |
number |
Result
<void
, ApplicationError
>
INativeEventBus.unsubscribe