Msw/2/Lifecycle Events Signature


Last update

Apr 23, 2024

In msw v2, lifecycle events callback methods have changed their signature. This codemod replaces usages if its arguments with the new ones.

Before'request:start', (req, reqId) => {
doStuff(req, reqId);

After'request:start', ({ request, requestId }) => {
doStuff(request, requestId);

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now