Skip to content

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

@pksorensen

Description

@pksorensen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions