Skip to content

Instantly share code, notes, and snippets.

@PavlikPolivka
Created December 1, 2021 20:39
Show Gist options
  • Save PavlikPolivka/fe092939c06ed4a18a5407b731a848fb to your computer and use it in GitHub Desktop.
Save PavlikPolivka/fe092939c06ed4a18a5407b731a848fb to your computer and use it in GitHub Desktop.
getDataCached('a').then(result => { console.log('first call outer: ' + result);
getDataCached('a').then(result => { console.log('first call inner: ' + result); });
});
getDataCached('b').then(result => { console.log('first call outer: ' + result);
getDataCached('b').then(result => { console.log('first call inner: ' + result); });
});
getDataCached('a').then(result => { console.log('second call outer: ' + result);
getDataCached('a').then(result => { console.log('second call inner: ' + result); });
});
setTimeout(() => {
getDataCached('a').then(result => { console.log('later call outer: ' + result);
getDataCached('a').then(result => { console.log('later call inner: ' + result); });
});
}, 70000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment