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

Passing property name in property observer effect to the observing method #3775

Closed
aahoo opened this issue Jul 11, 2016 · 2 comments
Closed
Labels

Comments

@aahoo
Copy link

aahoo commented Jul 11, 2016

Changing this line to

      fn.call(this, value, old, effect.property);

will make property observers way more useful. They can virtually replace the complex observer effect. In addition, the function being called knows what has changed from what to what to take the needed action.

@kaste
Copy link
Contributor

kaste commented Jul 23, 2016

Ideally we would just get the whole event information. See #3554 where I propose to also get the fromAbove value. Likewise #3573 where I propose custom effects which get both the path (property) you want and the fromAbove flag.

@tjsavage tjsavage added the 1.x label Sep 8, 2016
@TimvdLippe
Copy link
Contributor

In general simple observers do not need this information, as they should be unique. If you do want to have 1 observer for all your properties, you can implement that yourself with a solution like http://jsbin.com/jiyawurudo/edit?html,console,output In general, the advice is to not duplicate this behavior and instead use a complex observer for these purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants