freactive icon indicating copy to clipboard operation
freactive copied to clipboard

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

Open pkobrien opened this issue 10 years ago • 2 comments

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.))]

pkobrien avatar Jun 26 '15 13:06 pkobrien

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 [email protected] 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.

aaronc avatar Jun 26 '15 14:06 aaronc

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.

pkobrien avatar Jun 26 '15 16:06 pkobrien