title: How to use rxjs ajax operator instead of axios in my react project?
body: <p>I am new to rxjs and want to know how to handle this use case.</p>
  
  <p>This is <code>axios</code> promise, how to convert it so that it uses rxjs's ajax operator</p>
  
  <pre><code>export const onLogin = ({ username, password }) =&gt;
    axios({
      method: "post",
      url: O_TOKEN_URL,
      data: querystring.stringify({
        client_id: CLIENT_ID,
        client_secret: CLIENT_SECRET,
        grant_type: "password",
        username,
        password
      }),
      headers: {
        "Content-Type": "application/x-www-form-urlencoded"
      }
    });
  </code></pre>
  
  <p>This is my action,</p>
  
  <pre><code>export const onSubmit = payload =&gt; ({
    type: FETCH_USER,
    payload // payload contains username &amp; password
  });
  </code></pre>
  
  <p>This is my epic for now,</p>
  
  <pre><code>export const loginEpic = action$ =&gt;
    action$
      .ofType(FETCH_USER)
      // somehow import onLogin from above and resolve it
      // then, dispatch FETCH_USER_FULFILLED
      .do(
          payload =&gt; console.log(payload.username, payload.password)
          // i am able to console these username and password
      )
      .mapTo(() =&gt; null);
  </code></pre>
  
  <ul>
  <li>I want to resolve <code>onLogin</code> function somehow, when <code>FETCH_USER</code> is dispatched, using <code>rxjs's ajax operator</code>.  </li>
  <li>And, I want <code>onLogin</code> function, which returns <code>promise/observable</code>, to be set up in different file so that I can keep track of all the ajax requests </li>
  </ul>
  
  <p>These are the packages,</p>
  
  <pre><code>"redux-observable": "^0.18.0",
  "rxjs": "^5.5.10",
  </code></pre>
  
  <ul>
  <li>Could you also point me to a documentation that covers this and various use case for <code>post</code>, <code>put</code> ... requests? I couldn't find any.</li>
  </ul>