Skip to content

Multipe return paths from bindings #23

@egucciar

Description

@egucciar

Hi,

In our code we use bindingClassProvider extensively and in some scenerios we choose to dynamically return based upon the viewModel

example:

binding: function () {
    if (this.hover()) {
        return {
            event: {
                mouseover: this.hoverAction
            }
        };
    } else {
        return { };
    }
}

Will this work as expected and essentially "remove" the hoverAction handler when hover is false? Lets say hover can change dynamically from true to false. We would expect then for the event binding to have been disposed since the new return does not have it, but we are seeing that the event binding is persistant but its valueAccessor() now does not exist and it throws an error.

Thanks for your help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions