Msw/2/Lifecycle Events Signature
Last update
Jul 24, 2024
In msw v2, lifecycle events callback methods have changed their signature. This codemod replaces usages if its arguments with the new ones.
Before
server.events.on('request:start', (req, reqId) => {doStuff(req, reqId);});
After
server.events.on('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