New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Element getters? #175
Comments
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 |
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: