Closed johnjelinek closed 10 years ago
Hi John,
There isn't an explicit implementation of the do!
multimethod in Hoplon for the src
attribute currently. However, there is an :attr
method you could use like this:
(source :attr (cell= {"src" rpc/get-song}))
Alternatively, you could implement a do!
method for handling :src
yourself. However, I think this would be a handy addition to Hoplon. It's kind of weird we don't have it already :-)
@micha what do you think?
(source :attr (cell= {"src" rpc/get-song}))
worked :)
Do you want me to close this or should it remain open until you hear back from @micha regarding a do!
?
Hi! You could also do this, if you prefer:
(source :src rpc/get-song)
D'oh! What I said about :src
currently going unhandled by do!
is wrong - :src
falls through to ::default
which defers to the :attr
implementation.
The reason your original code didn't work is because text
returns an HTML TextNode with a reactive text content, not a cell. Since the TextNode isn't a cell, str
is called on it to obtain "[object Text]"
instead of :src
being wired reactively.
Please close this if this makes sense and you accept my apology for confusing the issue :smile:
cool, thanks for the update!
yields
How can I get this value into the
src
property?