SkillAgentSearch skills...

Knockout.underscore.plugin

Adds Underscore methods to Knockout Observable Array

Install / Use

/learn @thelinuxlich/Knockout.underscore.plugin
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Knockout.underscore plugin

This plugin adds all Underscore array methods(and object/array methods) to Observable Array.

Use it like you would with a normal array, the only difference is that you need to skip the first argument(which is the array). Example:

var VM = {
  arr: ko.observableArray(["bill","ted","rufus"])
};

alert(VM.arr.min(function(n){
   return n.length;
}));

//prints "ted"

Also, there are 11 new destructive methods that change the observable array:

  • .select_
  • .reject_
  • .invoke_
  • .sortBy_
  • .rest_
  • .compact_
  • .flatten_
  • .without_
  • .uniq_
  • .intersect_
  • .zip_

See Underscore.js documentation for more details.

View on GitHub
GitHub Stars28
CategoryDevelopment
Updated6y ago
Forks1

Languages

JavaScript

Security Score

75/100

Audited on Aug 13, 2019

No findings