Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addAfterDestroyHook called twice #547

Closed
may-day opened this issue Nov 21, 2024 · 2 comments
Closed

addAfterDestroyHook called twice #547

may-day opened this issue Nov 21, 2024 · 2 comments
Assignees

Comments

@may-day
Copy link

may-day commented Nov 21, 2024

Is it expected behaviour that the addAfterDestroyHook is called twice?
E.g.:

class App : Application(){
    var obsCreatenum = ObservableValue(1)
    var obsDestroynum = ObservableValue(0)
    override fun start() {
        root("kvapp") {
            button("wet trout").onClick{
                obsCreatenum.value++
            }
            div().bind(obsCreatenum){ createnum ->
                p {
                    +"Hello there, number $createnum"
                }.addAfterDestroyHook {
                    obsDestroynum.value++
                }
            }

            div().bind(obsDestroynum){ destroynum ->
                p{
                    +"Destroyed: $destroynum"
                }
            }
        }
    }
}
@rjaros
Copy link
Owner

rjaros commented Nov 22, 2024

Hello.
It's a bug, but a nasty one! Thanks for reporting, I'll try to fix this.

@rjaros rjaros self-assigned this Nov 22, 2024
@may-day
Copy link
Author

may-day commented Dec 4, 2024

Works now in 8.1.0. Thank you.

@may-day may-day closed this as completed Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants