File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 26
26
27
27
const gAPILoadAsObservable = Rx . Observable . bindCallback ( gapi . load ) ;
28
28
29
- const goog$ = url => Rx . Observable . of ( url )
29
+ const goog$ = url => Rx . Observable . of ( url )
30
30
. filter ( R . compose ( R . not , R . isEmpty ) )
31
- . map ( encodeURIComponent )
32
- . switchMap ( ( ) => gAPILoadAsObservable ( 'client' ) )
33
- . do ( ( ) => gapi . client . setApiKey ( GKEY ) )
34
- . switchMap ( ( ) => Rx . Observable . fromPromise ( gapi . client . load ( 'urlshortener' , 'v1' ) ) )
35
- . switchMap ( ( ) => Rx . Observable . fromPromise ( gapi . client . urlshortener . url . insert (
36
- { 'longUrl' : example_url } ) )
31
+ . switchMap (
32
+ encodedUri => gAPILoadAsObservable ( 'client' )
33
+ . do ( ( ) => gapi . client . setApiKey ( GKEY ) )
34
+ . switchMap ( ( ) => Rx . Observable . fromPromise ( gapi . client . load ( 'urlshortener' , 'v1' ) ) )
35
+ . switchMap ( ( ) => Rx . Observable . fromPromise (
36
+ gapi . client . urlshortener . url . insert ( { 'longUrl' : encodedUri } ) )
37
+ )
37
38
)
38
39
. filter ( obj => obj . status === 200 )
39
40
. pluck ( 'result' , 'id' ) ;
You can’t perform that action at this time.
0 commit comments