feat(network): update Network plugin (#3608)
Extends onChange Observable with types of connection to which it changed
This commit is contained in:
parent
2f69dd88cb
commit
31ee7efc22
@ -95,11 +95,11 @@ export class Network extends IonicNativePlugin {
|
||||
|
||||
/**
|
||||
* Returns an observable to watch connection changes
|
||||
* @return {Observable<any>}
|
||||
* @return {Observable<'connected' | 'disconnected'>}
|
||||
*/
|
||||
@CordovaCheck()
|
||||
onChange(): Observable<any> {
|
||||
return merge(this.onConnect(), this.onDisconnect());
|
||||
onChange(): Observable<'connected' | 'disconnected'> {
|
||||
return merge(this.onConnect().pipe(mapTo('connected')), this.onDisconnect().pipe(mapTo('disconnected'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user