I read this good article on Angular onPush Change Detection Strategy
at some potin he wrote:
It’s an anti-pattern to expose your subject to the outside world, always expose the observable, by using the asObservable() method.
but he doesn't explain why. Does this mean that I shouldn't do somthing like this?
export class ExampleComponent {
public drawerTrigger$ = new Subject<{}>();
}
and in the HTML
<button class="hamburgher-button" type="button"
(click)="drawerTrigger$.next($event)">
<i >menu</i>
</button>
if no, which is the proper way?