How to call a specific function before and after every fetch api request and response

I want to call a function during sending a request and after receiving response with every fetch() function using Vanilla JS.
I saw that jquery ajax is providing some kind of $.ajaxsetup for doing this but I want to do it with Vanilla JS.
Thanks in advance.