Skip to content

Commit

Permalink
Revert "Fix change detection with binary fields."
Browse files Browse the repository at this point in the history
This reverts commit 8d79023.
  • Loading branch information
jasongrout committed Aug 17, 2017
1 parent 9849869 commit b33ce39
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions packages/base/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,23 +500,9 @@ class WidgetModel extends Backbone.Model {
deserialized = {};
for (let k in state) {
if (serializers[k] && serializers[k].deserialize) {
// deserializers should not return an ArrayBuffer or
// DataView, but can return another Typed Array. Otherwise
// Backbone does not register the change because of
// https://github.com/jashkenas/underscore/issues/2692
deserialized[k] = (serializers[k].deserialize)(state[k], manager);
deserialized[k] = (serializers[k].deserialize)(state[k], manager);
} else {
// Work around
// https://github.com/jashkenas/underscore/issues/2692,
// which prevents Backbone from seeing that the state
// changed when comparing two dataviews or arraybuffers.
if (state[k] instanceof DataView) {
deserialized[k] = new Uint8Array(state[k].buffer);
} else if (state[k] instanceof ArrayBuffer) {
deserialized[k] = new Uint8Array(state[k])
} else {
deserialized[k] = state[k];
}
deserialized[k] = state[k];
}
}
} else {
Expand Down

0 comments on commit b33ce39

Please sign in to comment.