Skip to content

Instantly share code, notes, and snippets.

@wtfil
Created March 30, 2016 12:05
Show Gist options
  • Save wtfil/44a175bf97c5dc53b26409e3d07bb5ea to your computer and use it in GitHub Desktop.
Save wtfil/44a175bf97c5dc53b26409e3d07bb5ea to your computer and use it in GitHub Desktop.
cached promise
function readHugeData() {
readHugeData.promise = readHugeData.promise || asyncCallAsPromise();
return readHugeData.promise;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment