Skip to content

Instantly share code, notes, and snippets.

@lhahne
Created December 31, 2015 13:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save lhahne/3a3c8adaa492b560afe5 to your computer and use it in GitHub Desktop.
const token$ = rx.Observable.fromPromise(axios.get('/user'))
.map(response => response.data.token);
const get$ = path => token$.flatMap(token => rx.Observable.fromPromise(axios.get(`https://api.fitbit.com${path}`,
{headers: {Authorization: 'Bearer ' + token}})));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment