Debounce a function when you want it to execute only once after a defined interval of time. If the event occurs multiple times within the interval, the interval is reset each time.
Example A user is typing into an input field and you want to execute a function, such as a call to the server, only when the user stops typing for a certain interval, such as 500ms.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public sealed class ArrayBinder : IBindingList, ITypedList | |
{ | |
private sealed class ArrayColumn : PropertyDescriptor | |
{ | |
public ArrayBinder Owner { get; } | |
public int ColumnIndex { get; } | |
public ArrayColumn(ArrayBinder owner, int index) | |
: base($"[{index}]", null) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Isotope binding for Knockout 3+ | |
(c) Michael Best | |
Adapted by David Desmaisons to make it compatible with isotope 2.0 | |
License: MIT (http://www.opensource.org/licenses/mit-license.php) | |
*/ | |
"use strict"; | |
ko.bindingHandlers.isotope = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Documents; | |
using System.Windows.Controls; | |
using System.Windows; | |
using System.Collections.ObjectModel; | |
using System.Collections; | |
using System.Windows.Markup; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
fmod for Javascript, will work with any ECMA-262 implementation. | |
If you need a precision higher than 8, please use another implementation of fmod. | |
1.05 % 0.05 | |
=> 0.04999999999999999 | |
Math.fmod(1.05, 0.05) | |
=> 0 |