title: Model methods with NGXS
body: <p>I'm starting to integrate NGXS into my Angular project, and am facing a bit of a dilemma.  </p>
  
  <p>Currently, all my models are classes, which also contain methods that deal with the model (helper methods, as well as actions).<br>
  I'm aware of the fact that with NGXS, the actions should not be in the model objects and should move to the actions/states files.<br>
  However, I'm not sure what to do with the other methods.</p>
  
  <p>On the one hand, placing them inside the services seems artificial, as the services are used mostly for CRUD operations. Moreover, every tutorial I can find regarding Angular that does not include NGXS, advocates the use of model classes encapsulating the model's funtionality. </p>
  
  <p>On the other hand, all of the NGXS examples I've seen so far use only interfaces as models.</p>
  
  <p>Here's an example model class:</p>
  
  <pre><code>export class Person {
  
      static readonly ADULT_TIME = 18 * 365 * 24 * 60 * 60 * 1000;
  
      name: string;
      dateOfBirth: Date;
  
      constructor(name: string, dateOfBirth: Date) {
          this.name = name;
          this.dateOfBirth = dateOfBirth;
      }
  
      public isAdult(): boolean {
          return (Date.now() - this.dateOfBirth.getTime()) &gt;= Person.ADULT_TIME; 
      }
  }
  </code></pre>
  
  <p>An interface of such a model would be:</p>
  
  <pre><code>export interface Person {
      name: string;
      dateOfBirth: Date;
  }
  </code></pre>
  
  <p>Is there some standard approach as to what to do with the model related methods when working with NGXS (e.g. <code>isAdult()</code>), or alternatively, is it possible/advisable to work with model classes alongside NGXS ?</p>