-
-
Notifications
You must be signed in to change notification settings - Fork 931
Closed
Description
Heya!
Was playing around with this in a project, and it has been amazing!
Noticed the Selection.Map only allowing to return a string, so wanted to change that to generics so it could return anything as currently I've used Each every time (and manually putting it in the array), while Map would be nicer to use.
As such the change;
func (s *Selection) Map[T any](f func(int, *Selection) T) (result []T) {
for i, n := range s.Nodes {
result = append(result, f(i, newSingleSelection(n, s.document)))
}
return result
}Noticed the project is still on 1.13 when trying to add it myself, so was wondering if there are any plans to update to a newer version to allowed to usage of generics, and other later introduced features.
Thanks for the amazing project! 💕
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels