this.subscriptionObservable = new Observable<ShoppingCart>((observer: Observer<ShoppingCart>) => {
this.subscribers.push(observer);
observer.next(this.retrieve());
return () => {
this.subscribers = this.subscribers.filter((obs) => obs !== observer);
};
});
有人可以解释这行代码吗?