Skip to content
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

Handle setKeyValue case #36

Merged
merged 9 commits into from
Jun 22, 2020
Merged

Conversation

cherifGsoul
Copy link
Member

This fixes the case of setting properties with canReflect.setKeyValue that dispatches events more than once, the issue was caused after the changes to observable class fields:

class MyType extends ObservableObject {
}

const myType = new MyType();

canReflect.onKeyValue(myType, 'foo', (newVal) => {
    console.log(newVal); // -> 4 will be logged once
});

canReflect.setKeyValue(myType, 'foo', 4);

Fixes #35


const myType = new MyType();

assert.ok(myType.constructor.instances.has(myType));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be MyType.instances.has(myType). It's fine either way.

Copy link
Contributor

@phillipskevin phillipskevin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Node 12 requirement is curious, but go ahead publish.

@cherifGsoul cherifGsoul merged commit 8dfb02f into master Jun 22, 2020
@cherifGsoul cherifGsoul deleted the proxy-instances-to-proxy-mixin branch June 22, 2020 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setKeyValue dispatches multiple events
2 participants