kounderscore
v0.1.2
Published
Knockout Underscore integration.
Downloads
2
Maintainers
Readme
KoUnderscore
Knockout Underscore integration.
Installation
Using Bower:
$ bower install kounderscore --save
Using NuGet:
$ Install-Package KoUnderscore
Usage
You could use kounderscore in different context.
Browser (AMD from source)
Configure RequireJS.
requirejs.config({
paths: {
knockout: 'path/to/knockout',
underscore: 'path/to/underscore',
kounderscore: 'path/to/kounderscore'
}
});
Load modules
define(["knockout", "kounderscore"], function(ko, ko_) {
var obsArray = ko.observableArray([...]);
var regularFilteredArray = obsArray.filter(function(item) { return item.prop === value; });
var computedFilteredArray = obsArray._filter(function(item) { ... });
var computedArray = ko.computed(function() { return []; });
ko_.addToSubscribable(computedArray);
computedArray.filter(...);
});
Browser (with built file)
Include built script in your HTML file.
<script type="text/javascript" src="path/to/knockout.js"></script>
<script type="text/javascript" src="path/to/underscore.js"></script>
<script type="text/javascript" src="path/to/kounderscore.min.js"></script>
Documentation
Documentation is hosted on Github Wiki