Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Latest commit

 

History

History
180 lines (99 loc) · 3.31 KB

CommonEventBus.md

File metadata and controls

180 lines (99 loc) · 3.31 KB

@js-soft/native-common / Exports / CommonEventBus

Class: CommonEventBus

Implements

  • INativeEventBus

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new CommonEventBus()

Properties

eventBus

Private eventBus: EventBus

Defined in

CommonEventBus.ts:5


locked

Private locked: boolean = true

Defined in

CommonEventBus.ts:6


queue

Private queue: Event[] = []

Defined in

CommonEventBus.ts:7

Methods

init

init(): Promise<Result<void, ApplicationError>>

Returns

Promise<Result<void, ApplicationError>>

Implementation of

INativeEventBus.init

Defined in

CommonEventBus.ts:9


publish

publish(event): Result<void, ApplicationError>

Parameters

Name Type
event Event

Returns

Result<void, ApplicationError>

Implementation of

INativeEventBus.publish

Defined in

CommonEventBus.ts:29


subscribe

subscribe(event, handler): Result<number, ApplicationError>

Parameters

Name Type
event Event
handler (event: any) => void

Returns

Result<number, ApplicationError>

Implementation of

INativeEventBus.subscribe

Defined in

CommonEventBus.ts:14


subscribeOnce

subscribeOnce(event, handler): Result<number, ApplicationError>

Parameters

Name Type
event Event
handler (event: any) => void

Returns

Result<number, ApplicationError>

Implementation of

INativeEventBus.subscribeOnce

Defined in

CommonEventBus.ts:19


unsubscribe

unsubscribe(event, id): Result<void, ApplicationError>

Parameters

Name Type
event Event
id number

Returns

Result<void, ApplicationError>

Implementation of

INativeEventBus.unsubscribe

Defined in

CommonEventBus.ts:24