Add current location in localstorage, fixes #13

This commit is contained in:
Pieter Vander Vennet 2020-07-24 17:53:09 +02:00
parent 2a61ae6e1f
commit 89b78ee709
5 changed files with 28 additions and 25 deletions

View file

@ -67,7 +67,7 @@ export class UIEventSource<T>{
}
public syncWith(otherSource: UIEventSource<T>){
public syncWith(otherSource: UIEventSource<T>) : UIEventSource<T>{
this.addCallback((latest) => otherSource.setData(latest));
const self = this;
otherSource.addCallback((latest) => self.setData(latest));
@ -76,6 +76,7 @@ export class UIEventSource<T>{
}else{
otherSource.setData(this.data);
}
return this;
}
}