mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
chore(common): fix linter error (#2941)
fix linter error by using conditional expression instead of assigning to element in multiple places
This commit is contained in:
parent
b0dea6dc58
commit
e1a25af0b5
@ -144,16 +144,12 @@ function wrapObservable(pluginObj: any, methodName: string, args: any[], opts: a
|
|||||||
/**
|
/**
|
||||||
* Wrap the event with an observable
|
* Wrap the event with an observable
|
||||||
* @private
|
* @private
|
||||||
* @param event even name
|
* @param event event name
|
||||||
* @param element The element to attach the event listener to
|
* @param element The element to attach the event listener to
|
||||||
* @returns {Observable}
|
* @returns {Observable}
|
||||||
*/
|
*/
|
||||||
function wrapEventObservable(event: string, element: any): Observable<any> {
|
function wrapEventObservable(event: string, element: any): Observable<any> {
|
||||||
if (typeof window !== 'undefined') {
|
element = (typeof window !== 'undefined' && element) ? get(window, element) : element || typeof window !== 'undefined' || {};
|
||||||
element = element && typeof window !== 'undefined' ? get(window, element) : window;
|
|
||||||
} else {
|
|
||||||
element = element || {};
|
|
||||||
}
|
|
||||||
return fromEvent(element, event);
|
return fromEvent(element, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user