Skip to content

Instantly share code, notes, and snippets.

View lanwin's full-sized avatar
🤡
-

Steve Wagner lanwin

🤡
-
View GitHub Profile
@lanwin
lanwin / functional-utils.js
Created September 29, 2015 14:30 — forked from bendc/functional-utils.js
A set of pure and immutable ES2015 functions aimed to make functional JavaScript more idiomatic.
// 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)
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)
{