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

Latest commit

 

History

History
123 lines (70 loc) · 2.76 KB

INativeEventBus.md

File metadata and controls

123 lines (70 loc) · 2.76 KB

@js-soft/native-abstractions / Exports / INativeEventBus

Interface: INativeEventBus

Event bus used for sending and receiving messages

Table of contents

Methods

Methods

init

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

Initialize the event bus. Initially the event bus is in a locked state. Once an AppReadyEvent is fired (usually from outside), the event bus is unlocked. The locked event bus queues published events and publishes them once it is unlocked.

Returns

Promise<Result<void, ApplicationError>>

Defined in

src/INativeEventBus.ts:34


publish

publish(event): Result<void, ApplicationError>

Publish a specific event

Parameters

Name Type
event Event

Returns

Result<void, ApplicationError>

Defined in

src/INativeEventBus.ts:28


subscribe

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

Subscribe for a handler to be called each time a specific event occurs

Parameters

Name Type
event Event
handler Function

Returns

Result<number, ApplicationError>

Defined in

src/INativeEventBus.ts:12


subscribeOnce

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

Subscribe for a handler to be called the next time a specific event occurs

Parameters

Name Type
event Event
handler Function

Returns

Result<number, ApplicationError>

Defined in

src/INativeEventBus.ts:18


unsubscribe

unsubscribe(id): Result<void, ApplicationError>

Unsunscribe a handler from being called when a specific event occurs

Parameters

Name Type
id number

Returns

Result<void, ApplicationError>

Defined in

src/INativeEventBus.ts:23