Namespace: event
molecule.event
Classes
Interfaces
Variables
EventBus
• Const
EventBus: EventEmitter
Defined in
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
Name | Type | Description |
---|---|---|
name | string | Event name |
Returns
fn
▸ (target
, property
, descriptor
): PropertyDescriptor
Parameters
Name | Type |
---|---|
target | any |
property | string |
descriptor | PropertyDescriptor |
Returns
PropertyDescriptor
Defined in
subscribe
▸ subscribe(name
): (target
: any
, property
: string
, descriptor
: PropertyDescriptor
) => PropertyDescriptor
When the event emitted, it's going to call target function
Parameters
Name | Type | Description |
---|---|---|
name | string | string [] | Event name |
Returns
fn
▸ (target
, property
, descriptor
): PropertyDescriptor
Parameters
Name | Type |
---|---|
target | any |
property | string |
descriptor | PropertyDescriptor |
Returns
PropertyDescriptor