Skip to content

Instantly share code, notes, and snippets.

@seeruk
Created November 13, 2014 11:48
Show Gist options
  • Save seeruk/38161c4c7efcf28ef6ef to your computer and use it in GitHub Desktop.
Save seeruk/38161c4c7efcf28ef6ef to your computer and use it in GitHub Desktop.
cachingproxy.js
return Cache.proxy("foo", function() {
return $http({ method: "GET", url: "api/articles.json" })
.then(
function(result) {
return result.data.articles;
},
function(reason) {
throw new HttpException(null, reason.statusText, reason.status);
}
)
;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment