ratty-blush•2y ago
router.addHandler from a separate function
Say I have code like this:
Now I'm not particularly good in JS, so hoping that some JS gurus can chime in here, but is there any way that the callback
async ({ request, page, enqueueLinks, log }) => { ... }
could be put inside a separate function and instead pass the function to addHandler
?
So something like this:
2 Replies
Our team will reply here soon. Expect a little delay due to few holidays. 🙂
Hi, you can create a new function as follows:
You need to
export
it if you want to have it in different file.