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

Convert on_trait_change decorators to observe #654

Merged
merged 6 commits into from
Mar 2, 2021

Conversation

aaronayres35
Copy link
Contributor

part of #416

This PR replaces all uses of the @on_trait_change decorator with the observe equivalent.

@on_trait_change("svg_coords,mouse_in")
def ensure_redraw(self):
@observe("svg_coords,mouse_in")
def ensure_redraw(self, event=None):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method and cell_properties_changed in a later file are never called standalone, but they are not privately named. So I made event a kwarg to protect against breaks from other callers, but this is likely overkill/unneeded. I am happy to change this to just event if a reviewer prefers.

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aaronayres35 aaronayres35 merged commit 00ac7c6 into master Mar 2, 2021
@aaronayres35 aaronayres35 deleted the convert-otc-decorators-to-observe branch March 2, 2021 01:35
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.

2 participants