These are chat archives for canjs/canjs

17th
Nov 2015
Jan Jorgensen
@ramblinjan
Nov 17 2015 00:59
If I have a virtual property (using a can.Map.define get), if I use .attr(), should that virtual property's value be in the resulting object?
er, should that virtual property be in the resulting object?
Jan Jorgensen
@ramblinjan
Nov 17 2015 01:04
ah, nvm. saw that serialize() and attr() return the same thing (unless serialize is specifically defined for a virtual property, in this case)
Julian
@pYr0x
Nov 17 2015 08:32
@alexisabril interesting question.. can you make a simple jsbin ? :)
Alexis Abril
@alexisabril
Nov 17 2015 18:50
@pYr0x sure can, there may still be another issue relating to how classes get set
Julian
@pYr0x
Nov 17 2015 20:32
@alexisabril ok, nice don't know that can pass a deferred to fn() . can you show me the codeline where "isResolved" is set in the can.deferred
Alexis Abril
@alexisabril
Nov 17 2015 20:40
The isResolved, isPending, etc properties are all setup in can/compute/read
Julian
@pYr0x
Nov 17 2015 20:50
Ok found it.
maybe you can help me with a question that i ask justin, but he didnt answer yet. Why i cant listen to a deferred in a component event object. In compute/read there is a state event dispatch. Why the event listener in component didnt recorgnize that?
is the same logic in the stache system?
Alexis Abril
@alexisabril
Nov 17 2015 22:26
@pYr0x Hmm, not sure offhand. I assume you're trying something like '{someDeferred} isPending': function() {}
I'll have to try that out
Note on the above jsbin for those interested: I wrote a workaround by just using an element callback in the helper. When the promise resolves, the element is modified programmatically.
Julian
@pYr0x
Nov 17 2015 22:56
@alexisabril workaround for what?
Julia Allyce
@julia-allyce
Nov 17 2015 23:46
Question, if I have a list from superMapConnection.getList() and I call model.destroy() on a model in that list, will the model be removed from the list? or do I need to use destroy on the connection?
Alexis Abril
@alexisabril
Nov 17 2015 23:57
@pYr0x You can't have a helper that resolves a promise inside of an elements attribute
*currently
<div class="{{#promiseHelper}}{{#if isResolved}}{{value}}{{/if}}{{/promiseHelper}}"> for example
the helper won't be live bound to the promise