Skip to content

Instantly share code, notes, and snippets.

@lhahne lhahne/fitbitget.js
Created Dec 31, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.