refactor(events): add deprecations (#19103)

This commit is contained in:
Manu MA
2019-08-27 18:20:07 +02:00
committed by GitHub
parent c3044f59df
commit ef34402960

View File

@ -7,6 +7,11 @@ export type EventHandler = (...args: any[]) => any;
export class Events { export class Events {
private c = new Map<string, EventHandler[]>(); private c = new Map<string, EventHandler[]>();
constructor() {
console.warn(`[DEPRECATION][Events]: The Events provider is deprecated and it will be removed in the next major release.
- Use "Observables" for a similar pub/sub architecture: https://angular.io/guide/observables
- Use "Redux" for advanced state management: https://github.com/angular-redux/platform/tree/master/packages/store`);
}
/** /**
* Subscribe to an event topic. Events that get posted to that topic will trigger the provided handler. * Subscribe to an event topic. Events that get posted to that topic will trigger the provided handler.
* *