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