Created
May 21, 2019 19:04
-
-
Save arturovt/c66962bb0208f84ad91e1954a8cb82b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SelectSnapshot } from '@ngxs-labs/select-snapshot'; | |
@Injectable({ providedIn: 'root' }) | |
export class UserService { | |
@SelectSnapshot(UserState.getUserId) | |
public id: number; | |
constructor(private http: HttpClient) {} | |
public getUser() { | |
return this.http.get(`${environment.apiUrl}/users/${this.id}`); | |
} | |
public getLoginHistory() { | |
return this.http.get(`${environment.apiUrl}/users/login-history/${this.id}`); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment