Skip to content

Commit

Permalink
flag openHealth.getJSON.store
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasalmeida committed Aug 27, 2015
1 parent 2b710d6 commit 07b392c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions openHealth.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ this.xhr=function(url,meth,fun){ // XMLHttpRequest

this.getJSON=function(url,fun,store){
if(!this.getJSON.cache){ // if caching not enabled
if(!store){store=openHealth.getJSON.store}
this.xhr(url,function(x){
fun(JSON.parse(x.target.responseText))
if(store){localforage.setItem(encodeURIComponent(url),y);} // if store is true cache nonetheless
Expand Down

0 comments on commit 07b392c

Please sign in to comment.