Dispatcher
export class UpdateMessage extends Message {
constructor(payload?: any) {
super('MessageName', payload);
}
}Publish message
Dispatcher.publish(new UpdateMessage('payload'));
// or
Dispatcher.publish('UPDATE_MESSAGE', 'payload');Receive message
Dispatcher.subscribe(UpdateMessage as any, (payload: any) => {
this.actions.update....
});
// or
Dispatcher.subscribe('UPDATE_MESSAGE', (payload: any) => {
this.actions.update....
});Last updated