Fork me on GitHub
#clojurescript
<
2016-05-15
>
madvas09:05:47

Has anybody met this error when trying js->clj on js object? given js object is for sure not undefined or sth like that

#object[TypeError TypeError: Cannot read property 'cljs$lang$ctorStr' of undefined]
TypeError: Cannot read property 'cljs$lang$ctorStr' of undefined

koolkat12:05:41

Hello, i have a weird problem. Using reframe i dispatch an event on keyup and send the event object to the handler but when the object arrives it has its atributes set to null. So if handle the object before dispatching its ok but if i send it and try to do something with it on the handler it does not work. Any ideas why?

mccraigmccraig17:05:39

@koolkat: probably the event object is getting recycled... get what you need from it in your on-key-up handler before you dispatch

koolkat17:05:27

Thanks @mccraigmccraig, i find it just very weird for a variable to change like that, because its a tiny aplication and im checking inmediatly. If by recycled you mean there is some sort of object pool i cant understand under which circumstances this coud happen. I was just curious.

kauko19:05:37

"If you want to access the event properties in an asynchronous way, you should call event.persist() on the event, which will remove the synthetic event from the pool and allow references to the event to be retained by user code." Thanks for the link @mccraigmccraig , I've come across this but never realised what's it about

kauko19:05:08

It wasn't anything important to me, just a curiosity, so I never bothered to study it more