Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dxvladislavvolkov committed Apr 11, 2017
1 parent 319ba55 commit fb73fd6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/watcher-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ export class WatcherHelper {
}

private _isDifferentValues(oldValue: any, newValue: any, deepCheck: boolean) {
if (deepCheck && newValue instanceof (Object) && oldValue instanceof (Object) &&
!(oldValue instanceof Date && newValue instanceof Date)) {
let isObjectValues = newValue instanceof Object && oldValue instanceof Object,
isDateValues = oldValue instanceof Date && newValue instanceof Date;

if (deepCheck && isObjectValues && !isDateValues) {
return this._checkObjectsFields(newValue, oldValue);
}
return oldValue !== newValue;
Expand Down

0 comments on commit fb73fd6

Please sign in to comment.