Closed hopleus closed 3 months ago
What is your use case for this?
Hi. In the application, I use both a router and a BottomSheet. If everything is fine in the case of using the router, because onUnmount is launched when the page address is changed, then in the case of the BottomSheet I ran into the problem of superimposing click events on the MainButton (one MainButton for the page, the other for the BottomSheet).
P.S. BottomSheet I use this - https://github.com/Jannchie/vue-ios-sheet P.P.S I want to be able to control the MainButton click events myself :)
Thank you. How about this API? Does it meet your needs?
import { useWebApp } from "vue-tg"
const { onEvent } = useWebApp()
const { unsubscribe } = onEvent(
"mainButtonClicked",
() => {
/* main button handler */
},
{
manual: true, // 1. Add option to disable auto-unsubscribe
},
)
// 2. Manually unsubscribe later
unsubscribe()
Thank you. How about this API? Does it meet your needs?
import { useWebApp } from "vue-tg" const { onEvent } = useWebApp() const { unsubscribe } = onEvent( "mainButtonClicked", () => { /* main button handler */ }, { manual: true, // 1. Add option to disable auto-unsubscribe }, ) // 2. Manually unsubscribe later unsubscribe()
I think so
What is your use case for this?