cloudworker
cloudworker copied to clipboard
respondWith should no-op/throw when called outside context of fetch event
addEventListener('fetch', async event => {
await Promise.resolve();
// In production, this is a no-op because respondWith was not called immediately.
// cloudworker is returning the response. Perhaps it should throw to help folks catch issues quickly.
event.respondWith(new Response('hello world'));
});
thanks! I'll take a look at this sometime soon.