I have been working on a lightning component where I came across a scenario.
My component calls an Apex class on "init" and I also have a custom renderer that does something. However, my custom renderer implementation of afterRender is called before the "init" completes (because the server is taking time to finish) and as a result component attributes are not set. Now, if I try to fetch component attributes values in afterRender, I get undefined for all the attributes that depend on init.
Is there any possible way to make sure that "render" and "afterRender" are only called after "init finishes" and not after "init is started" ?