async bind not called after module disposed
i've injecting async bind to certain module, when the module first initialized it called async bind. but when module got disposed and initialized again, it didnt call async bind method again. is there any ways to called the async bind method when module got initialized every time ? thanks
Hi! @komangnopha , can you provide a small POC?
thx for your response @raphaelbarbosaqwerty
here is my module that injecting asyncBind method

here my method that injected with asyncBind
take a look i've added debug code there
i've added await isModuleReady in my guard

in the first initialization, injected bind is called when module was initialized

but after module disposed, and then initialize again, the injected bind not called again

is there anything wrong in my code ? thx before
Hey! In fact this is normal behavior. The resolution of an AsyncBind is done only once, as it is expected that a Bind will exit from there. If you need to run it every time, try Modular.getAsync() instead.
Another detail. AsyncBind generates a Bind with the Future's return, so if it's returning a bool, it will create a Bind
Hope this helps/
thanks @jacobaraujo7 for your answer. i thought i can using AsyncBind everytime before initialize one module, in my case, i need AsyncBind to ensure that one method in controller A is called before initialize module A, and then when entering another module i can use data provided by controller A without called it everytime using modular.getAsync.
FYI i'm using router outlet, and i was mention about root module (module A) that contain another module as children