knockout-init
v1.0.0
Published
Module for initializing knockout observables
Downloads
4
Maintainers
Readme
knockout-init
Module for initializing knockout observables.
Usage
<div data-bind="init: { key: foo, value: 'bar' }"></div>
var foo = ko.observable(null);
foo.subscribe(function (val) {
// val === "bar" --> true
});
Installation
This is how I use it with a Webpack bundled project. Your setup may be different.
$ npm install knockout-init --save-dev
import ko from "knockout";
import init from "knockout-init";
ko.bindingHandlers.init = init(ko);