nl_tokens: Make a network request .
pl_tokens: function ( method , url , options ) { if ( ! options . headers ) { options . headers = { } ; } options . headers [ 'Authorization' ] = 'Bearer ' + this . token ; this . rs . _emit ( 'wire-busy' , { <mask> : method , isFolder : isFolder ( url ) } ) ; return WireClient . request . call ( this , method , url , options ) . then ( ( xhr ) => { // Google tokens expire from time to time... if ( xhr && xhr . status === 401 ) { this . connect ( ) ; return ; } else { if ( ! this . online ) { this . online = true ; this . rs . _emit ( 'network-online' ) ; } this . rs . _emit ( 'wire-done' , { method : method , isFolder : isFolder ( url ) , success : true } ) ; return Promise . resolve ( xhr ) ; } } , ( error ) => { if ( this . online ) { this . online = false ; this . rs . _emit ( 'network-offline' ) ; } this . rs . _emit ( 'wire-done' , { method : method , isFolder : isFolder ( url ) , success : false } ) ; return Promise . reject ( error ) ; } ) ; }