-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new can-connect map instance returns an instance initialized with previous object #441
Comments
So the problem with the following: var Todo = DefineMap.extend("Todo",{
id: {identity: true, type: "number"},
task: "string",
get _serialize() {
return this.serialize();
}
});
const TodoList = DefineList.extend({
"#": Todo
});
superMap({
Map: Todo,
List: TodoList,
url: "/services/todos",
name: "todo"
});
queues.log();
var t1 = new Todo({ id: 1, task: "Do something 1" });
t1.on("_serialize", () => {});
// can-event-queue
obj.constructor[dispatchBoundChangeSymbol](obj, true)
SolutionsThe most obvious solution is to prevent binding changes on the prototype from dispatching |
Fixed by: canjs/can-event-queue#20 |
Please check the behavior of this sample code:
https://codepen.io/anon/pen/JmEdZR?editors=1011
The expected console output should be:
But the current result is:
Apparently it is somehow related with constructorStore behavior.
The text was updated successfully, but these errors were encountered: