Skip to main content
Version: Next

Namespace: event

molecule.event

Classes

Interfaces

Variables

EventBus

Const EventBus: EventEmitter

Defined in

common/event/eventBus.ts:3

Functions

emit

emit(name): (target: any, property: string, descriptor: PropertyDescriptor) => PropertyDescriptor

Emit decorator, when the function be called, it's going to notify the listener

Parameters

NameTypeDescription
namestringEvent name

Returns

fn

▸ (target, property, descriptor): PropertyDescriptor

Parameters
NameType
targetany
propertystring
descriptorPropertyDescriptor
Returns

PropertyDescriptor

Defined in

common/event/decorator.ts:8


subscribe

subscribe(name): (target: any, property: string, descriptor: PropertyDescriptor) => PropertyDescriptor

When the event emitted, it's going to call target function

Parameters

NameTypeDescription
namestring | string[]Event name

Returns

fn

▸ (target, property, descriptor): PropertyDescriptor

Parameters
NameType
targetany
propertystring
descriptorPropertyDescriptor
Returns

PropertyDescriptor

Defined in

common/event/decorator.ts:30