Skip to content

Instantly share code, notes, and snippets.

@mbest
mbest / OutputUnusedBindings.js
Last active January 1, 2016 11:59
Tags each binding and records which ones are actually used. Later, you can log which ones haven't been used using `ko.outputUnusedBindings` (this also clears the log).
/*
Output Unused Bindings for Knockout 3+
(c) Michael Best
License: MIT (http://www.opensource.org/licenses/mit-license.php)
*/
(function (ko) {
var originalGetBindingAccessors = ko.bindingProvider.instance.getBindingAccessors;
if (!originalGetBindingAccessors) {
@mbest
mbest / mbest-knockout-isotope.js
Last active June 30, 2016 15:54
Isotope binding for Knockout, using "arrayChange" feature of Knockout 3.0. Example: http://jsfiddle.net/mbest/ACSGx/
/*
Isotope binding for Knockout 3+
(c) Michael Best
License: MIT (http://www.opensource.org/licenses/mit-license.php)
*/
"use strict";
ko.bindingHandlers.isotope = {
init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {