Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
docs(ObjectObservable): finish documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
adriancarriger committed Mar 25, 2017
1 parent d25bdbd commit c185b57
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/afo-object-observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,24 @@ import { OfflineWrite } from './offline-write';
import { LocalUpdateService } from './local-update-service';

export class AfoObjectObservable<T> extends ReplaySubject<T> {
/**
* The Firebase path used for the related FirebaseObjectObservable
*/
path: string;
/**
* The current value of the {@link AfoObjectObservable}
*/
value: any;
/**
* An array used to store write operations that require an initial value to be set
* in {@link value} before being applied
*/
que = [];
/**
* Creates the {@link AfoObjectObservable}
* @param ref a reference to the related FirebaseObjectObservable
* @param localUpdateService the service consumed by {@link OfflineWrite}
*/
constructor(private ref, private localUpdateService: LocalUpdateService) {
super(1);
this.init();
Expand Down Expand Up @@ -121,6 +136,9 @@ export class AfoObjectObservable<T> extends ReplaySubject<T> {
this.value = value;
}
}
/**
* Sends the the current {@link value} to all subscribers
*/
private updateSubscribers() {
this.next(unwrap(this.ref.$ref.key, this.value, () => this.value !== null));
}
Expand Down

0 comments on commit c185b57

Please sign in to comment.