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

ObservableSet.size is not observable #2

Open
iownbey opened this issue Nov 5, 2024 · 1 comment
Open

ObservableSet.size is not observable #2

iownbey opened this issue Nov 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@iownbey
Copy link
Contributor

iownbey commented Nov 5, 2024

const set = observable(new Set());

reaction(() => set.size, (size) => console.log("size changed"));

set.add(7);

This code isn't triggering a reaction due to a missing wrapper around the native Set.size call

@jereklas jereklas added the bug Something isn't working label Dec 15, 2024
@jereklas
Copy link
Owner

jereklas commented Dec 16, 2024

I assume this also exists on maps, should verify when we make a fix.

Also verify that the following causes a reaction:

const map = observable(new  Map());

reaction(() => map, () => console.log("map changed"));

map.set("a","a")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants