This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This proof-of-concept is to demonstrate how someone might make debounced network requests | |
where _each_ request returns a value - rather than just the "bounced" calls getting ignored | |
Essential concept - while network request is in progress, more requests for the exact same | |
data are "attached" to the original request and all would then complete at the same time. | |
*/ | |
// mockup of the real network get function (redis, http, db, etc...) | |
async function realGetData(key: string) { |