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

Replace notification when resulting collection is not empty in ReplaceRange method #85

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

simusr2
Copy link

@simusr2 simusr2 commented Mar 18, 2021

When resulting collection is not empty Replace notification should be raised instead of Reset.

@ahoke-cr
Copy link

@jamesmontemagno would you consider this change? The Reset event is not accurate when replacing the existing items with a new collection of items.

@jamesmontemagno
Copy link
Owner

I need to think about this because the ReplaceRange is literally clearing it and adding the new items, which is a reset of the collection.

According to the documentaiton Reset should be called when it is cleared and then Replace should be called when an actual item was replaced... so like item[3] = newitem.

So i dont' think this logic is correct.

I could see doing a Reset when I clear it and then a Add when I add items, but how I have it today when You clear and add the range in it's place a Reset is correct as it is resetting the collection.....

@ahoke-cr
Copy link

Reset should be called when it is cleared and then Replace should be called when an actual item was replaced

Then the committed changes conform to this, no?

@jamesmontemagno
Copy link
Owner

Well I think replace is when a single item or other item is replaced in a specific order. I need to read some docs. Really my method is a Reset method, not a replace, as a replace is a single item. I need to read the docs, I am not sure what impact would have on current apps. I also don't know what the issue is today with using Reset, that wasn't described in the PR.

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.

3 participants