Best way to have onCreate/onDestroy on a Node #285
-
What is the best way to have an For example I have a And also this would have to be repeated in case I navigate to this node again later: new scope would have to be created and then destroyed on exit. I want to be able to do this from within the node itself, not from its parent. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
@dimsuz you can use |
Beta Was this translation helpful? Give feedback.
@dimsuz you can use
lifecycleScope
in the Node. It's created when theNode
is created and the scope is cancelled automaticallyonDestroy