git: wrap up nogit state

This commit is contained in:
Joao Moreno
2017-02-16 10:15:38 +01:00
parent ac703e0d92
commit 3d6b1b71c5
5 changed files with 111 additions and 77 deletions

View File

@@ -28,6 +28,8 @@ export function combinedDisposable(disposables: IDisposable[]): IDisposable {
return toDisposable(() => dispose(disposables));
}
export const EmptyDisposable = toDisposable(() => null);
export function mapEvent<I, O>(event: Event<I>, map: (i: I) => O): Event<O> {
return (listener, thisArgs = null, disposables?) => event(i => listener.call(thisArgs, map(i)), null, disposables);
}