These are chat archives for canjs/canjs

12th
May 2015
dylanrtt
@dylanrtt
May 12 2015 16:55
I have an issue with a component's viewmodel trying to asynchronously modify a property after the component is removed from the view. http://jsbin.com/mehivocove/3/edit?html,js,console,output
what would be the ideal approach to what I am trying to achieve in that example whilst still using dom removal?
Mick McGrath
@mickmcgrath13
May 12 2015 20:23
I'm sure you guys are aware of this, but it seems that several things that reference 'http://canjs.com/release/latest/' are broken. See http://bitovi.github.io/canui/ and the 'popular counting circle example' (http://jsfiddle.net/JMWf4/47/)
Kyle Gifford
@kylegifford
May 12 2015 21:31
What is the expected value of 'foo' in this case? Keeping in mind setVal() is not passing in newVal as a param:
var Map = can.Map.extend({
    define: {
        foo: {
            value: '',
            set: function (newVal, setVal) {
                setVal();
                return;
            },
        },
    }
});

var map = new Map();
map.attr('foo', 'bar');
console.log(map.attr('foo')) // undefined or 'bar'?
Justin Meyer
@justinbmeyer
May 12 2015 21:33
@kylegifford I would expect foo to always be undefined
is it?
Kyle Gifford
@kylegifford
May 12 2015 21:33
yes
Justin Meyer
@justinbmeyer
May 12 2015 21:33
yeah, your setter never sets a value
is that not what you expected?
setVal takes an argument
you need to pass it something
calling it w/o an argument sets undefined
Kyle Gifford
@kylegifford
May 12 2015 21:35
it is - a project's test wasn't passing and i wanted to double check that's the correct functionality for setVal
i created a test in the canjs repo and it is passing (returning undefined, correctly) so i'll move along to the project code itself
thanks
Justin Meyer
@justinbmeyer
May 12 2015 22:33
@mickmcgrath13 Thanks!
Is canui linked to from anywhere?
Mick McGrath
@mickmcgrath13
May 12 2015 23:17
Not that I've seen other than from within the list of Bitovi GitHub repositories
The jsfiddle I mentioned is referenced on the 'Why CanJS' guide, though. (http://canjs.com/guides/Why.html#section_Fast)