Skip to content

Instantly share code, notes, and snippets.

@balocodes
Last active July 4, 2019 10:43
Show Gist options
  • Save balocodes/0236d64d1c9f25531d995aec674f5c7a to your computer and use it in GitHub Desktop.
Save balocodes/0236d64d1c9f25531d995aec674f5c7a to your computer and use it in GitHub Desktop.
import { Injectable } from "@angular/core";
import * as Rx from "rxjs";
@Injectable()
export class CommsService {
// Observable with initial value set to false
private waitingListStatus = new Rx.BehaviourSubject(false);
// Updates the value of waitingListStatus
updateWaitingList = (status: boolean) => {
// Updates it's current value and notifies subscribers
this.waitingListStatus.next(status);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment