Hi guys. This is just a simple question which i have not found the answer on google. Some people preferred beforeenter for authentication or similar. Then what about async?
- What is the async method ROLE on framework7?
- Is it the same as beforeenter?
- Which lifecycle stage is async? is it start from beforemounted or init?
- What if i want to use async for everything such as authenticate user, load axios, preloader, and navigate(resolve/reject) ?
4.1) Is it going to impact my apps on performance?
4.2) Is it safe for authentication part ?
4.3) Assuming async is good, but when i am going to use it, my routes.js would be full
with code since async is kinda tightly coupled with routes method. Is there any proper
way to clean up a bit our code? (This is more like your personal opinion/way)
Reason of my question as such is because i am planning to work authentication, axios, preloader and navigate which must come in order for each page. Similarly i want to my apps to:
- check if the user is authenticate,
- If axios is needed don’t navigate to the page first but open preloader with custom text while getting the data,
- When requesting the data is complete, then can navigate to the particular page.
Which is why i come across with beforeenter & async topic since these two seems my solution to do all mentioned above.
EDITED: i have already found this link but seems not answering my question
If the docs already answered my question above, please include a link so that i can refer to it later.
Thanks a lot guys.