rename append for objects to update
This commit is contained in:
@@ -44,8 +44,8 @@ describe('UniqueObjectBehaviorSubject', () => {
|
||||
}
|
||||
});
|
||||
|
||||
subject.append({key: 'change_this_first_should_not_trigger_update'});
|
||||
subject.append({another: 'myNewValue'});
|
||||
subject.update({key: 'change_this_first_should_not_trigger_update'});
|
||||
subject.update({another: 'myNewValue'});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export class UniqueObjectBehaviorSubject<T> extends UniqueBehaviorSubject<T> {
|
||||
* const mySubject = new UniqueObjectBehaviorSubject(data)
|
||||
* mySubject.append({value: 'myNewValue'})
|
||||
*/
|
||||
append(partialData: Partial<T>) {
|
||||
update(partialData: Partial<T>) {
|
||||
this.next({ ...this.getValue(), ...partialData });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user