This commit is contained in:
Joao Moreno
2017-01-27 09:31:06 +01:00
parent 6fba7f3483
commit 343e7036ef

View File

@@ -59,6 +59,7 @@ export function eventToPromise<T>(event: Event<T>): Promise<T> {
return new Promise(c => once(event)(c));
}
// TODO@Joao: replace with Object.assign
export function assign<T>(destination: T, ...sources: any[]): T {
for (const source of sources) {
Object.keys(source).forEach(key => destination[key] = source[key]);