Miss any of our Open RFC calls?Watch the recordings here! »

kounderscore

0.1.2 • Public • Published

# KoUnderscore Build Status Bower version NuGet version

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

Install

npm i kounderscore

DownloadsWeekly Downloads

7

Version

0.1.2

License

MIT

Last publish

Collaborators

  • avatar