Skip to content

Commit f7dbdc1

Browse files
committed
Add description to updateArrayDataFromChangedElement
1 parent d195ee9 commit f7dbdc1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/LiveComponent/assets/src/update_array_data.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/**
2-
* Resolve multiple value data from changed HTML element.
2+
* Adds or removes a key from an array element based on an array element.
3+
*
4+
* Given an "array" element (e.g. )
5+
* and the current data for "preferences" (e.g. ["text", "phone"]), this function will add or
6+
* remove the value (e.g. email) from that array (based on if the element (un)checked) and
7+
* return the final, updated array (e.g. ["text", "phone", "email"]).
38
*
49
* @param element Current HTML element
510
* @param value Resolved value of a single HTML element (.value or [data-value])

0 commit comments

Comments
 (0)