Custom text binding handler I created this custom binding handler:

ko.bindingHandlers.line = {
    update: function (element, valueAccessor, allBindings) {
        // First get the latest data that we're bound to
        var value = valueAccessor();

        // Next, whether or not the supplied model property is observable, get its current value
        var valueUnwrapped = ko.unwrap(value);

        // Now manipulate the DOM element
        if (valueUnwrapped) {
            $(element).after('&lt;br /&gt;');   // Make the element invisible
        }
        return ko.bindingHandlers.text.update(element, function () {
            return valueUnwrapped;
        })
    }
};


I'm wondering about the part where I do ko.bindingHandlers.text.update.  Is there a better way to solve this?

Is it the only way to update the DOM with ko.bindingHandler.text.update, or is there any more straightforward way to do it?
You can call it more directly using this:

return ko.bindingHandlers.text.update(element, valueAccessor);


The valueAccessor is already a function that returns the value, and update already uses unwrap internally, so there is no need to use the inline function.

Or more safely, preserving the other arguments to the handler, you can call it like this:

return ko.bindingHandlers.text.update.apply(this, arguments);


However, wrapping text binding handler is better done with a preprocessor, to ensure that other parts of the binding lifecycle are handled normally.

ko.bindingHandlers.line = {
    preprocess: function (value, name, addBinding) {
        addBinding('text', value);
        return value;
    },
    update: function (element, valueAccessor, allBindings) {
        if (ko.unwrap(valueAccessor())) {
            $(element).after('&lt;br /&gt;');   // Make the element invisible
        }
    }
};


Here is a fiddle.