Skip to content

Replace NO_CHANGE with WrappedValue#1517

Closed
vsavkin wants to merge 2 commits into
angular:masterfrom
vsavkin:cd_remove_no_change
Closed

Replace NO_CHANGE with WrappedValue#1517
vsavkin wants to merge 2 commits into
angular:masterfrom
vsavkin:cd_remove_no_change

Conversation

@vsavkin

@vsavkin vsavkin commented Apr 24, 2015

Copy link
Copy Markdown
Contributor

Currently we use NO_CHANGE to indicate that the result of a pipe transformation has not changed. Any other value will be treated as a change. This means that this pipe

function double(n) {
 return n  * 2
}

will not work. Change detection will throw in the dev mode!

This PR changes it. So if you return the same value, it won't be treated as a change. You need to return a new value to trigger a change.

If you want to trigger a change even though you don't have a new object (e.g., IterableDiff), you need to wrap it into WrappedValue.

@mhevery mhevery added @lgtm action: merge The PR is ready for merge by the caretaker labels Apr 24, 2015
@vsavkin vsavkin closed this in 818bb9b Apr 29, 2015
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants