Skip to content

Instantly share code, notes, and snippets.

@octaviogb
Forked from octavioturra/secure.fetch.js
Created May 31, 2016 20:58
Show Gist options
  • Save octaviogb/20057285f88c5c32eca76fabae9fce55 to your computer and use it in GitHub Desktop.
Save octaviogb/20057285f88c5c32eca76fabae9fce55 to your computer and use it in GitHub Desktop.
Fetch secured
class Fetch {
create(store : object) {
if(!window.__fetch) {
window.__fetch = new Fetch()
}
Object.defineProperty(window.__fetch, 'state', {
get() {
return store.getState().login
}
});
return window.__fetch;
}
onTokenChange(cb : function) {
this._onTokenChange = cb;
}
checkStatus(request) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment