fix(change_detection): expose values when detecting changes in key-value pairs
Fixes #1118 Closes #1123
This commit is contained in:
@@ -54,6 +54,24 @@ export function main() {
|
||||
}));
|
||||
});
|
||||
|
||||
it('should expose previous and current value', () => {
|
||||
var previous, current;
|
||||
|
||||
MapWrapper.set(m, 1, 10);
|
||||
changes.check(m);
|
||||
|
||||
MapWrapper.set(m, 1, 20);
|
||||
changes.check(m);
|
||||
|
||||
changes.forEachChangedItem((record) => {
|
||||
previous = record.previousValue;
|
||||
current = record.currentValue;
|
||||
})
|
||||
|
||||
expect(previous).toEqual(10);
|
||||
expect(current).toEqual(20);
|
||||
});
|
||||
|
||||
it('should do basic map watching', () => {
|
||||
changes.check(m);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user