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
Once again, a great library. Thank you so much for this! :)
I was wondering if you would be amenable to having the functions defined under $.setProps be written to work as both "getters" and "setters"? By this I simply mean that if you pass a param to the function (e.g. Bliss.properties(subject, props) or subject._.properties(props)) it functions as a "setter", but if you simply call the function without a param (e.g. Bliss.properties(subject) or subject._.properties()) it functions as a "getter".
My initial implementation is fairly rudimentary, but it has worked for the use-cases I have. I am simply checking for the existence of the single param and splitting the functionality into two code paths accordingly. To take properties as a simple example:
Obviously, not every function in $.setProps can have both a "getter" and a "setter", but plenty could. And I think the functionality would be quite helpful (I personally need "getters" for attributes and properties).
Once again, thank you for all of your hard work,
stephen
The text was updated successfully, but these errors were encountered:
Not sure about this. How often do people need to get ALL properties or ALL attributes from an element? It seems like a special case to me, and as you pointed out, it can already be done in 1 line (for attributes just do $$(this.attributes).map(attribute => attribute.name)). We should be mindful of bloat, otherwise we'll end up with yet another bloated library.
What do others think?
That said, Bliss should be extensible enough to allow third party devs to do this via plugins. We already have a hooks system, though it cannot intercept the return value, so maybe we should work on that.
Lea,
Once again, a great library. Thank you so much for this! :)
I was wondering if you would be amenable to having the functions defined under
$.setProps
be written to work as both "getters" and "setters"? By this I simply mean that if you pass a param to the function (e.g.Bliss.properties(subject, props)
orsubject._.properties(props)
) it functions as a "setter", but if you simply call the function without a param (e.g.Bliss.properties(subject)
orsubject._.properties()
) it functions as a "getter".My initial implementation is fairly rudimentary, but it has worked for the use-cases I have. I am simply checking for the existence of the single param and splitting the functionality into two code paths accordingly. To take
properties
as a simple example:Obviously, not every function in
$.setProps
can have both a "getter" and a "setter", but plenty could. And I think the functionality would be quite helpful (I personally need "getters" forattributes
andproperties
).Once again, thank you for all of your hard work,
stephen
The text was updated successfully, but these errors were encountered: