Calling lifecycle hooks multiple times in the component instance #9344
Closed
Oleksii14
started this conversation in
General Discussions
Replies: 1 comment
-
Usage example: export default {
setup() {
useSubscriptions('event1');
useSubscriptions('event2');
// etc
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone! I met a specific way of using
onMounted/onBeforeUnmount
hooks.Here is a function:
This function may be called many times in the same component instance inside
setup
. My question: is this better than using subscriptions directly inonMounted
hook in the componentscript
? Is callingonMounted
or other hooks multiple times in the component safe? Tell me you thinkBeta Was this translation helpful? Give feedback.
All reactions