Make http[verb] a partial applicable #2242
Replies: 1 comment
-
Hi, @cloud-walker. Thanks for sharing this! I think this is perfect for the userland, and you are encouraged to make any custom utilities around request handling if they make sense in the context of your app. At the same time, I think this kind of abstraction doesn't belong in the core of MSW. I am of a strong belief that a tool should provide you with LEGO bricks and then you build what you want. I also believe there should be no more than 1 way to solve a problem so the consumer isn't stuck in the uncertainty of how to, say, intercept a request. What I recommend is this: if you believe this is a helpful utility, publish it on NPM! This way, it will work in addition to MSW, be explicit, and anybody can enjoy it! |
Beta Was this translation helpful? Give feedback.
-
Hi! Reading this docs I had the idea to make a util myself that works the same way the
http
object works, but in a more partial applicable way, here is my implementation:This way you can:
I think that should be integrated directly inside
msw
Beta Was this translation helpful? Give feedback.
All reactions