react-digraph icon indicating copy to clipboard operation
react-digraph copied to clipboard

Change "selected" property to "selectedNodeOrEdge"

Open ajbogh opened this issue 5 years ago • 1 comments

Is your feature request related to a problem? Please describe. The "selected" property can cause some confusion because it doesn't inform the developer if it's a node or edge, or both. This property should change to "selectedNodeOrEdge" to be more clear.

Describe the solution you'd like We want to inform the developers about the expected types through variable or property names as well as type information. In this case "selectedNodeOrEdge" is more clear to the developer than "selected".

The "selected" property can be deprecated in the code and then later removed in the following major release. Deprecation warnings should be included for developers still using "selected".

Additional context https://github.com/uber/react-digraph/issues/240#issuecomment-670979525

ajbogh avatar Aug 09 '20 05:08 ajbogh

Renaming selected to selectedNodeOrEdge will help developers learn react-digraph faster and make fewer mistakes like the ones I blundered into in https://github.com/uber/react-digraph/issues/240#issuecomment-670979525.

mosofsky avatar Aug 10 '20 01:08 mosofsky