rniemeyer/knockout-classBindingProvider

Unwrapping observables

christo8989 opened this issue · 1 comments

I'm creating a custom binding and trying to unwrap the observables that are being returned.

I realize that I could setup the object to take the value instead of the observable, but I don't think it should be necessary to do that.

var bindings = {
    value: ko.observable('some value'),
};

ko.bindingHandler.custom = function () {
    init: function (element, valueAccessor, allBindings, viewmodel, bindingContext) {
        var option = ko.unwrap(valueAccessor().value);
    },
};

This is a super basic example of what I'm trying to do.

Nvm. My code was doing something unexpected.