Skip to content

Instantly share code, notes, and snippets.

@octavioturra
Created May 31, 2016 04:03
Show Gist options
  • Save octavioturra/0b2901d305747adb5132b131a0f4ca89 to your computer and use it in GitHub Desktop.
Save octavioturra/0b2901d305747adb5132b131a0f4ca89 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