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