There are a series of components that will reveal themselves after running a custom method viewChildRef.show()
on them (I'm using a @ViewChild
reference).
The problem is that the state gets updated with a @Select
decorator (angular-redux/store) initially before the child component is ready - the callback in the subscription needs to be called after ngAfterViewChecked
has triggered.
What is best practice to delay a call to a child component until a specific hook occurs? For those that don't know angular-redux/store, I have a rxjs subscription to play with from the @select decorator. Maybe a delay/debounce set up would work?
I can and have already set a variable readyForShow
that is set to true, and then again false once ngAfterViewChecked
is called. This is a tedious solution - there must be a better way, and this must be common in the angular-redux world.
My goal is to have something easily and quickly applied when I need to do this elsewhere as well.
Additionally, if there is a ready made solution in ngrx feel free to mention this - it will cause me to consider switching libraries and may help others!