Skip to content

Instantly share code, notes, and snippets.

@Termina1
Last active August 29, 2015 14:17
Show Gist options
  • Save Termina1/10d2bc3e2acb315aae8d to your computer and use it in GitHub Desktop.
Save Termina1/10d2bc3e2acb315aae8d to your computer and use it in GitHub Desktop.
latency-effect-1
function getValue(id, cache, retrieveValue) {
if(cache.has(id)) {
return cache.get(id);
} else {
// синхронный запрос к удаленному источнику
return retrieveValue(id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment