import { Injectable } from '@angular/core';
import { LocalStorageService } from 'angular-2-local-storage';

@Injectable()

export class UserService {

  constructor(protected localStorageService: LocalStorageService) { }

  // Todo make an interface for the return value
  userInfo(): any {
    return this.localStorageService.get('userInfo');
  }

  setUserInfo(userInfo): any {
    this.localStorageService.set('userInfo', userInfo);
  }

  clear() {
    this.localStorageService.clearAll();
  }

}
