Skip to content

Instantly share code, notes, and snippets.

@melvinlee
Created June 30, 2016 02:42
Show Gist options
  • Save melvinlee/4eff018ba5cf7450fe1acd6e9e0d69c2 to your computer and use it in GitHub Desktop.
Save melvinlee/4eff018ba5cf7450fe1acd6e9e0d69c2 to your computer and use it in GitHub Desktop.
Disposable Action
internal class DisposableAction : IDisposable
{
private readonly Action _action;
public DisposableAction(Action action)
{
_action = action;
}
public void Dispose()
{
_action?.Invoke();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment