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

How do you do foreach on the base projection arrays. #21

Open
pksorensen opened this issue Jun 9, 2014 · 0 comments
Open

How do you do foreach on the base projection arrays. #21

pksorensen opened this issue Jun 9, 2014 · 0 comments

Comments

@pksorensen
Copy link

This might be a very trivial knowckout question, but I am just wondering if there is a better way for this case:


selectedItems.subscribe(changes => {
    changes.forEach(change => {
        if (change.status === 'added') {
        }
    })
},null, "arrayChange");
items().forEach(i=> i.isSelected(true));

where items is a observable array and selectedItems is a filtered array on the isSelected property. What I see is that the changes event is always only having 1 element, where I would expect there could be some performance to gain if it actually only broadcasted the change once with all the changes. I am thinking I might need to do something with the way I select all items but i tried with valueWIllMutate and valueHasMutated, but same results.

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

No branches or pull requests

1 participant