Fork me on GitHub

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


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?


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


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.


"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


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