title: Typescript: ReferenceError: Cannot access 'Store' before initialization
body: <p>I have a class Store which incapsulates State (mobx used).</p>
  
  <pre><code>export class Store&lt;State&gt; {
      @observable
      public state: State;
  
      constructor(protected rootStore: RootStore, state: State) {
          this.state = state || ({} as State);
      }
  
      @action
      setState(state: State) {
          this.state = {
              ...this.state,
              ...state
          };
      }
  }
  
  </code></pre>
  
  <p>And I'm trying to implement a class <code>UserState</code>:</p>
  
  <pre><code>interface UserState {
      authorised?: boolean;
      loading?: boolean;
      name?: string;
      balance?: number;
  }
  
  export class UserStore extends Store&lt;UserState&gt; {
      constructor(rootStore: RootStore) {
          super(rootStore, {
              authorised: false,
              loading: true,
              name: ''
          })
      }
  }
  </code></pre>
  
  <p>Everything seems right for me, but I have an error:</p>
  
  <p><code>ReferenceError: Cannot access 'Store' before initialization</code></p>
  
  <p>I simply trying to set some default values in a store and it seems in a <code>Store</code> it's inside a constructor, so it's initialized obviously.</p>
  
  <p><a href="https://i.stack.imgur.com/HrtTq.png" rel="noreferrer"><img src="https://i.stack.imgur.com/HrtTq.png" alt="enter image description here"></a></p>