Can extension boot files attach functions to the app instance lifecycle hooks #10469
Replies: 2 comments
-
You'd need to handle the native |
Beta Was this translation helpful? Give feedback.
-
If you are a desktop application specialist, |
Beta Was this translation helpful? Give feedback.
-
I understand the use of lifecycle methods in Vue components.
I don't understand how the lifecycle hooks for the app instance interact with the boot files for extensions.
Given that I have create a boot file, using Amplify as an example, then
Amplify.configure
here. I also putDataStore.start
here as it doesn't depend on any Quasar/Vue setup being completed.export default boot
function is executed after the router default export is run and has access to the app instance, etc. so it can call app.use() if needed.So essentially the boot file code runs as part of the app created lifecycle hook.
What I want to know is how to run some boot file code when the app is being destroyed.
Just imagine that I need to release some resource. This could be to disconnect from bluetooth. It could be to clear all data for the current user from the cache or local storage. There are numerous things that might need to be done during app shutdown. (I am new to Quasar/Vue so my perception of reality is based on writing typical desktop applications, where asking a user if they want to save a file before exiting an app is commonplace.)
Beta Was this translation helpful? Give feedback.
All reactions