mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-12 22:03:03 -05:00
refactor: move libs
This commit is contained in:
15
apps/angular/6-structural-directive/src/app/user.store.ts
Normal file
15
apps/angular/6-structural-directive/src/app/user.store.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { User } from './user.model';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class UserStore {
|
||||
private user = new BehaviorSubject<User | undefined>(undefined);
|
||||
user$ = this.user.asObservable();
|
||||
|
||||
add(user: User) {
|
||||
this.user.next(user);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user