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

DefineMap fires 'set' event when a new property is added #400

Closed
m-mujica opened this Issue Oct 11, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@m-mujica
Copy link
Contributor

m-mujica commented Oct 11, 2018

Expected: it should fire an add event instead.

import { DefineMap, Reflect } from "//unpkg.com/can@5/core.mjs";

Reflect.onPatches(obj, handler);
obj.set("foo", "bar");  
obj.set("foo", "baz");  

Calling obj.set("foo", "bar"); for the first time, logs the following patch event:

0: {type: "set", key: "foo", value: "bar"}

The type should add since the property was not defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment