mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 08:23:10 +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
|
||||
* @private
|
||||
* @param event even name
|
||||
* @param event event name
|
||||
* @param element The element to attach the event listener to
|
||||
* @returns {Observable}
|
||||
*/
|
||||
function wrapEventObservable(event: string, element: any): Observable<any> {
|
||||
if (typeof window !== 'undefined') {
|
||||
element = element && typeof window !== 'undefined' ? get(window, element) : window;
|
||||
} else {
|
||||
element = element || {};
|
||||
}
|
||||
element = (typeof window !== 'undefined' && element) ? get(window, element) : element || typeof window !== 'undefined' || {};
|
||||
return fromEvent(element, event);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user