Skip to content

Commit

Permalink
docs(Selection): add info on the methods mutating the original values
Browse files Browse the repository at this point in the history
  • Loading branch information
meszaros-lajos-gyorgy committed Apr 28, 2024
1 parent 1c57535 commit 452b986
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,12 @@ type OverloadsOf$ = {
(items: Zone[]): ZonesSelection
}

/**
* Calling methods on the selected items will mutate the original values
* unless you create a copy of them with the `.copy()` method
* the copied (or original if no copy has been called) values can
* be read with the `.get()` method.
*/
export const $: OverloadsOf$ = <U extends Array<any>, T extends Selection<U>>(items: T | ArrayLikeArxTypes) => {
if (items instanceof Selection) {
return items
Expand Down

0 comments on commit 452b986

Please sign in to comment.