mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
watch function to generic function
This commit is contained in:
@@ -41,8 +41,8 @@ export class ConfigurationService {
|
||||
this.emitChange(key);
|
||||
}
|
||||
|
||||
public watch(key: DefaultConfigKey | string): BehaviorSubject<any>{
|
||||
const newSub = new BehaviorSubject(this.get(key));
|
||||
public watch<T>(key: DefaultConfigKey | string): BehaviorSubject<T>{
|
||||
const newSub = new BehaviorSubject<T>(this.get(key));
|
||||
if(!this.subscribers.has(key)){ this.subscribers.set(key, []); }
|
||||
this.subscribers.get(key).push(newSub);
|
||||
return newSub;
|
||||
|
||||
Reference in New Issue
Block a user