Skip to content

Commit

Permalink
docs(list): move comments to public methods
Browse files Browse the repository at this point in the history
  • Loading branch information
adriancarriger committed Jun 29, 2017
1 parent 7d0928a commit 066e147
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
25 changes: 25 additions & 0 deletions src/database/list/afo-list-observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,40 @@ export class AfoListObservable<T> extends ReplaySubject<T> {
.then(newValue => this.next(<any>newValue));
});
}
/**
* Wraps the AngularFire2 FirebaseListObservable [push](https://goo.gl/nTe7C0) method
*
* - Emulates a push locally
* - Calls the AngularFire2 push method
* - Saves the write locally in case the browser is refreshed before the AngularFire2 promise
* completes
*/
push(value: any) {
return this.internalListObservable.push(value);
}
/**
* Wraps the AngularFire2 FirebaseListObservable [remove](https://goo.gl/MkZTtv) method
*
* - Emulates a remove locally
* - Calls the AngularFire2 remove method
* - Saves the write locally in case the browser is refreshed before the AngularFire2 promise
* completes
* @param remove if you omit the `key` parameter from `.remove()` it deletes the entire list.
*/
remove(key?: string) {
return this.internalListObservable.remove(key);
}
uniqueNext(newValue) {
this.internalListObservable.uniqueNext(newValue);
}
/**
* Wraps the AngularFire2 FirebaseListObservable [update](https://goo.gl/oSWgqn) method
*
* - Emulates a update locally
* - Calls the AngularFire2 update method
* - Saves the write locally in case the browser is refreshed before the AngularFire2 promise
* completes
*/
update(key: string, value: any) {
return this.internalListObservable.update(key, value);
}
Expand Down
25 changes: 0 additions & 25 deletions src/database/list/internal-list-observable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ export class InternalListObservable<T> extends ReplaySubject<T> {
this.updated++;
}
}
/**
* Wraps the AngularFire2 FirebaseListObservable [push](https://goo.gl/nTe7C0) method
*
* - Emulates a push locally
* - Calls the AngularFire2 push method
* - Saves the write locally in case the browser is refreshed before the AngularFire2 promise
* completes
*/
push(value: any) {
const promise = this.ref.$ref.push(value);
this.emulate('push', value, promise.key);
Expand All @@ -99,30 +91,13 @@ export class InternalListObservable<T> extends ReplaySubject<T> {
this.localUpdateService);
return promise;
}
/**
* Wraps the AngularFire2 FirebaseListObservable [update](https://goo.gl/oSWgqn) method
*
* - Emulates a update locally
* - Calls the AngularFire2 update method
* - Saves the write locally in case the browser is refreshed before the AngularFire2 promise
* completes
*/
update(key: string, value: any) {
this.emulate('update', value, key);

const promise = this.ref.update(key, value);
this.offlineWrite(promise, 'update', [key, value]);
return promise;
}
/**
* Wraps the AngularFire2 FirebaseListObservable [remove](https://goo.gl/MkZTtv) method
*
* - Emulates a remove locally
* - Calls the AngularFire2 remove method
* - Saves the write locally in case the browser is refreshed before the AngularFire2 promise
* completes
* @param remove if you omit the `key` parameter from `.remove()` it deletes the entire list.
*/
remove(key?: string) {
this.emulate('remove', null, key);
const promise = this.ref.remove(key);
Expand Down

0 comments on commit 066e147

Please sign in to comment.