Challenge 1
Queue a deferred fetch.
const record = ('/collect', {
method: 'POST',
body: JSON.stringify(batch),
activateAfter: 30_000,
});
Press Ctrl⌘Enter to check your answer
Fill in the missing fetchLater options, quota constants, and fallback ladder rungs.
Challenge 1
const record = ('/collect', {
method: 'POST',
body: JSON.stringify(batch),
activateAfter: 30_000,
});
Press Ctrl⌘Enter to check your answer
Challenge 2
export const DEFERRED_QUOTA = ; // 10x the keepalive pool, separate accounting
Press Ctrl⌘Enter to check your answer
Challenge 3
fetchLater('/collect', {
method: 'POST',
body: payload,
: 30_000,
});
Press Ctrl⌘Enter to check your answer
Challenge 4
export async function sendBatch(batch: Batch) {
if (caps.fetchLater) return via(batch);
if (caps.sendBeacon) return viaBeacon(batch);
return viaKeepalive(batch);
}
Press Ctrl⌘Enter to check your answer
Challenge 5
const record = fetchLater('/collect', init);
// changed your mind:
record.();
Press Ctrl⌘Enter to check your answer