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

Updated types, function definitions, and optional properties. #247

Merged
merged 1 commit into from
Aug 5, 2020

Conversation

ajbogh
Copy link
Contributor

@ajbogh ajbogh commented Aug 5, 2020

Updated types, function definitions, and optional properties. The code doesn't require all methods if the user doesn't want to use them.

this.props.onSelectNode(null);
this.props.onDeleteNode(selectedNode, nodeId, newNodesArr);
if (onSelectNode) {
onSelectNode(null);

Choose a reason for hiding this comment

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

one option could be to default prop to () => {} so it means you don't need if conditions throughout the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good idea. I'm planning a rewrite using functions so I will consider it in the next iteration.

@ajbogh ajbogh merged commit 88a77f3 into uber:master Aug 5, 2020
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