Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
preview fetching
FST_PreviewRequests = [];
function FST_RegisterDocPreviewFetch(a) {
ULShpi: ;
FST_PreviewRequests.push(a)
}
var gTotReq = 0,
gTotReqSent = 0;
function FST_StartDocPreviewFetch(b, c) {
ULShpi: ;
gTotReq = c;
for (var a = 0; a < b; a++) FST_DocPreviewFetch()
}
function FST_DocPreviewFetch() {
ULShpi: ;
if (FST_PreviewRequests.length > 0 && gTotReqSent < gTotReq) {
FST_PreviewRequests.shift().invoke();
gTotReqSent++
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment