aaronc / freactive

High-performance, pure Clojurescript, declarative DOM library
http://documentup.com/aaronc/freactive
Eclipse Public License 1.0
387 stars 27 forks source link

Uncaught Error: No protocol method IDOMImage.-get-dom-image defined for type #50

Open pkobrien opened 9 years ago

pkobrien commented 9 years ago

For objects that are missing this protocol method, would it make sense for freactive to wrap them in a (str foo) call? That would save one from having to do that for cases like this one:

    [:p "Date/Time " (str (goog.date.DateTime.))]
aaronc commented 9 years ago

Yes, I agree this should be default. Although usually for dates you should have some locale formatting - with IDOMImage a custom rendering could be providing by extending the protocol.

On Fri, Jun 26, 2015 at 9:24 AM, pkobrien notifications@github.com wrote:

For objects that are missing this protocol method, would it make sense for freactive to wrap them in a (str foo) call? That would save one from having to do that for cases like this one:

[:p "Date/Time " (str (goog.date.DateTime.))]

— Reply to this email directly or view it on GitHub https://github.com/aaronc/freactive/issues/50.

pkobrien commented 9 years ago

I agree that extending a protocol is a viable option, and that there might be a need for special formatting. However, at this point I keep running into this error when I just want to throw a value into an element and display it in the browser. Sometimes it works, sometimes it doesn't. So it would be nice to have a default str wrapper. Which doesn't stop me from extending a protocol in the future in cases where that makes sense to do so.