Skip to content

Instantly share code, notes, and snippets.

@lmauri
lmauri / PromiseDeferredCSharp
Created February 19, 2014 11:15
Implementation of Promise/Deferred pattern with C#
public interface IPromise
{
/// <summary>
/// Attaches a callback to be executed when the Deferred is resolved
/// </summary>
IPromise Done(Action callback);
/// <summary>
/// Attaches a callback to be executed when the Deferred is rejected
/// </summary>
IPromise Fail(Action<Exception> callback);