From bd345818f874884dede161be45f176df552956fe Mon Sep 17 00:00:00 2001 From: Nicolas HENRY Date: Mon, 27 Aug 2018 01:38:22 +0200 Subject: [PATCH] fix(core): wrapEventObservable (#2660) * fix wrapEventObservable * fix lint --- src/@ionic-native/core/decorators/common.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/@ionic-native/core/decorators/common.ts b/src/@ionic-native/core/decorators/common.ts index d4a856615..82fc67847 100644 --- a/src/@ionic-native/core/decorators/common.ts +++ b/src/@ionic-native/core/decorators/common.ts @@ -167,11 +167,7 @@ function wrapObservable( * @returns {Observable} */ function wrapEventObservable(event: string, element: any): Observable { - if (element) { - get(window, element); - } else { - element = window; - } + element = element ? get(window, element) : window; return fromEvent(element, event); }