Public Lab
Add meaningful return values for toolbar manipulation methods
Problem
We have toolbar manipulation methods #addTool #removeTool and #replaceTool for L.DistortableImage.Edit:
Currently, the return results for them could be more purposeful.
Solution
I think a good route to go would be to return false on failure like they already do, and the toolbar object itself on success to allow for chaining and more concise code. Open to other suggestions for a return value if you feel they would be better.
To complete:
addToolneeds a meaningful return value on success (undefined currently)removeToolneeds a meaningful return value on success & failure (undefined currently)replaceToolneeds a meaningful return value on success (undefined currently)- document these return values in the README (just follow the current documentation pattern - see other tool related methods documented for reference)
Additional Information
Please find further information on installation, solving, & getting help on the linked issue.
Thank you 😊
Task tags
Students who completed this task
Sparks