title: How to dynamically change base URL using redux-toolkit?
body: <p>I use the redux toolkit to create an API
  The question is short: how to dynamically change the baseUrl in the API?
  The question in detail:
  Here is the createApi method
  An object is passed to this method, one of the keys of which is &quot;baseQuery&quot;</p>
  <pre class="lang-js prettyprint-override"><code>export const WebApi = createApi({
      reducerPath: 'API',
      baseQuery: fetchBaseQuery({ baseUrl: 'http://localhost:3001/api' }),
      endpoints: () =&gt; ({}),
  });
  </code></pre>
  <p>And here's the question, how do I dynamically change the baseUrl?  It is in the store, but I can't just put it here.
  I tried the solution from the customization  query documentation
  <a href="https://redux-toolkit.js.org/rtk-query/usage/customizing-queries#constructing-a-dynamic-base-url-using-redux-state" rel="nofollow noreferrer">https://redux-toolkit.js.org/rtk-query/usage/customizing-queries#constructing-a-dynamic-base-url-using-redux-state</a></p>
  <p>But it does not allow to change exactly the baseUrl, only dynamically process the request itself, which already comes AFTER the baseUrl</p>
  <p>So, how can I get and change baseUrl in the createApi method?</p>