@@ -57,19 +57,21 @@ function AnnotationEditor({
5757 const isEmpty = ! text && ! tags . length ;
5858
5959 const onEditTags = useCallback (
60+ /** @param {string[] } tags */
6061 tags => {
6162 store . createDraft ( draft . annotation , { ...draft , tags } ) ;
6263 } ,
6364 [ draft , store ]
6465 ) ;
6566
66- /**
67- * Verify `newTag` has content and is not a duplicate; add the tag
68- *
69- * @param {string } newTag
70- * @return {boolean } - `true` if tag is added
71- */
7267 const onAddTag = useCallback (
68+ /**
69+ * Verify `newTag` has content and is not a duplicate; add the tag
70+ *
71+ * @param {string } newTag
72+ * @return {boolean } Tag was added to the draft's tags; `false` if duplicate
73+ * or empty
74+ */
7375 newTag => {
7476 if ( ! newTag || tags . indexOf ( newTag ) >= 0 ) {
7577 // don't add empty or duplicate tags
@@ -84,13 +86,13 @@ function AnnotationEditor({
8486 [ onEditTags , tags , tagsService ]
8587 ) ;
8688
87- /**
88- * Remove a tag from the annotation.
89- *
90- * @param {string } tag
91- * @return {boolean } - `true` if tag extant and removed
92- */
9389 const onRemoveTag = useCallback (
90+ /**
91+ * Remove tag from draft if present.
92+ *
93+ * @param {string } tag
94+ * @return {boolean } Tag removed from draft
95+ */
9496 tag => {
9597 const newTagList = [ ...tags ] ; // make a copy
9698 const index = newTagList . indexOf ( tag ) ;
@@ -115,6 +117,7 @@ function AnnotationEditor({
115117 * @param {boolean } isPrivate
116118 */
117119 const onSetPrivate = useCallback (
120+ /** @param {boolean } isPrivate */
118121 isPrivate => {
119122 store . createDraft ( annotation , {
120123 ...draft ,
0 commit comments