跳到主要内容
版本:0.9.0-beta.2

Namespace: event

molecule.event

Classes

Variables

EventBus

EventBus: EventEmitter

Defined in

src/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

src/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

src/common/event/decorator.ts:30