mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
20 lines
388 B
TypeScript
20 lines
388 B
TypeScript
|
import {Injectable} from '@angular/core';
|
||
|
import {BehaviorSubject} from 'rxjs';
|
||
|
|
||
|
@Injectable()
|
||
|
export class VersionService {
|
||
|
|
||
|
public version: BehaviorSubject<string>;
|
||
|
|
||
|
constructor() {
|
||
|
this.version = new BehaviorSubject<string>(null);
|
||
|
}
|
||
|
|
||
|
public onNewVersion(version: string) {
|
||
|
if (this.version.value === version) {
|
||
|
return;
|
||
|
}
|
||
|
this.version.next(version);
|
||
|
}
|
||
|
}
|