title: Angular 2 - Convenient way to store in session
body: <p>Is there a convenient way to save in sessionStorage without the need to manually watch for property changes and update?</p>
  
  <p>I have a SearchComponent with a property "query" for example.</p>
  
  <pre><code>export class SearchComponent {
      private query: String;
      private searchResult: SearchResult;
      ...
  </code></pre>
  
  <p>Every time the query or the searchResult changes (and there are even more properties), i have to manually update sessionStorage.</p>
  
  <pre><code>sessionStorage.setItem('query', query);
  </code></pre>
  
  <p>Something like an annotation that does the job automatically would be great:</p>
  
  <pre><code>export class SearchComponent {
      @SessionStored
      private query: String;
      @SessionStored
      private searchResult: SearchResult;
      ...
  </code></pre>
  
  <p>I already found a similar solution <a href="https://github.com/marcj/angular2-localStorage" rel="noreferrer">here</a>. But this one did not work for <em>sessionStorage</em>.</p>