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
// array utils | |
// ================================================================================================= | |
const combine = (...arrays) => [].concat(...arrays); | |
const compact = arr => arr.filter(Boolean); | |
const contains = (() => Array.prototype.includes | |
? (arr, value) => arr.includes(value) | |
: (arr, value) => arr.some(el => el === value) |
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 static class FunctionalBindingExtensions | |
{ | |
public static Action<T2> Bind<T1, T2>(this Action<T1, T2> action, Func<T1> getValueFunc) | |
{ | |
return action.Bind(getValueFunc()); | |
} | |
public static Action<T1> Bind<T1, T2>(this Action<T1, T2> action, Func<T2> getValueFunc) | |
{ |