Currently, I have a driver's provider that monitors changes in my firestore database and updates the status of a driver pickup request. Here is the function responsible for this process:
getDriverPickupRequest(id)
{
this.DriverCollection.doc<Driver>(id).valueChanges()
.subscribe(data => {
this.pickuprequest.changePickupStatus(data.pickupRequest);
}
Furthermore, I have implemented a service that keeps track of these changes and broadcasts them to my homepage.
private pickupRequest = new BehaviorSubject<boolean>(false);
public pickupStatus = this.pickupRequest.asObservable();
changePickupStatus(value: boolean) {
this.pickupStatus.emit(value);
}
constructor(public http: HttpClient) {
//console.log('Hello PickuprequestProvider Provider');
}
However, an error message stating 'this.pickupStatus.emit is not a function' is now appearing. Can anyone help identify what may be wrong with the current code?