Using effect in ngOnInit

In Angular, the effect method is typically limited to use within the constructor. However, there are times when we may want to use it…