Skip to content

Instantly share code, notes, and snippets.

@renestein
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renestein/54fc961c87dd9f521034 to your computer and use it in GitHub Desktop.
Save renestein/54fc961c87dd9f521034 to your computer and use it in GitHub Desktop.
public virtual Action Wrap(Action action)
{
checkIfDisposed();
if (action == null)
{
throw new ArgumentNullException("action");
}
return () => Dispatch(action);
}
public virtual Action Wrap(Func<Task> function)
{
checkIfDisposed();
if (function == null)
{
throw new ArgumentNullException("function");
}
return () => Dispatch(function);
}
public virtual Func<Task> WrapAsTask(Action action)
{
checkIfDisposed();
if (action == null)
{
throw new ArgumentNullException("action");
}
return () => Dispatch(action);
}
public virtual Func<Task> WrapAsTask(Func<Task> function)
{
checkIfDisposed();
if (function == null)
{
throw new ArgumentNullException("function");
}
return () => Dispatch(function);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment