You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 21, 2020. It is now read-only.
After using this in a few projects, it seems like it would be a better API if the function accepted a collection of DOM elements, rather than a data attribute. The active and inactive streams would then also be updated to emit elements, rather than "names".
Benefits:
Delegate querying elements to the parent program. This allows any group of elements to be used, and doesn't force the data-attribute approach currently being used. This also means that we can remove the dependency on @standard-library/q-prime.
Reduced querying—if the collection of nodes is already available in the parent program, the DOM query currently in the function is duplicative. Also, by only returning a "name", doing anything with that active "name" mean performing another query to get the DOM nodes.
Issues:
The function currently takes names instead of elements in order to return only unique names (and to remove duplicates if there are elements with the same name). If this argument is changed and retaining this behavior is desired, another argument might need to be supplied, e.g.:
After using this in a few projects, it seems like it would be a better API if the function accepted a collection of DOM elements, rather than a data attribute. The
activeandinactivestreams would then also be updated to emit elements, rather than "names".Benefits:
@standard-library/q-prime.Issues:
namesinstead of elements in order to return only unique names (and to remove duplicates if there are elements with the same name). If this argument is changed and retaining this behavior is desired, another argument might need to be supplied, e.g.: