title: Observables: Validate dummy data from a mock class without http
body: <p>I'm learning Observables and trying to implement a service for login validation.
  Dummy data is like this</p>
  
  <pre class="lang-js prettyprint-override"><code>export class Users {
    public users: IUser[] = [];
  
    constructor() {
      this.users = [
        new IUser({ username: "protagonist", password: "hello123" }),
        new IUser({ username: "rono67", password: "!@vioped" }),
        new IUser({ username: "donaldtrump", password: "melenia@34" })          
      ];
    }
  </code></pre>
  
  <p>and structure of IUser is like this.</p>
  
  <pre class="lang-js prettyprint-override"><code>export class IUser {
      usename:string;
      password:string;
  }
  </code></pre>
  
  <p>I'm passing the entered username and password to the service class and I want to have an observable call which traverse through the dummy data and if it finds the matching credentials, it shall return it. I do not want to make any HTTP call. Method is something like this-</p>
  
  <pre><code> validLogin(accountInfo: IUser): Observable&lt;IUser&gt; {
          return ---------
            .map((user:IUser) =&gt; user.filter((user:IUser) =&gt; user.usernanme == accountInfo.username &amp;&amp; user.password == accountInfo.password);
        }
  </code></pre>
  
  <p>I'm not sure what piece of code needs to be written in the place of return ------. All of the results which I got in the web are implementing "return this.http.post"</p>
  
  <p>Is it possible to apply RxJs on mock data? Kindly suggest.</p>