These are chat archives for canjs/canjs

11th
May 2016
Dovid Bleier
@dbleier
May 11 2016 16:46
real-time.js
var update = function(props) {
    var self = this;

    this.listStore.forEach(function(list, id){
        var set = JSON.parse(id);
        // ideally there should be speed up ... but this is fine for now.


        var index = indexOf(self, props, list);

        if(canSet.subset(props, set, self.algebra)) {

            // if it's not in the list, update the list with this and the lists data merged
            // in the future, this should update the position.
            if(index == -1) {
                // get back the list items
                var items = self.serializeList(list);
                self.updatedList(list,  { data: setAdd(self, set,  items, props, self.algebra) }, set);
            }

        }  else if(index != -1){
            // otherwise remove it
            var items = self.serializeList(list);
            items.splice(index,1);
            self.updatedList(list,  { data: items }, set);
        }

    });
};
now it's failing the subset if statement and since it's in the list it gets removed :(
the reason is the set is user:'dovid' but the props doesn't have a user property, rather it has path:'dovid/... and so it fails the subset check
how do I overwrite canSet.subset to make my own comparison? this is on a superMap, when calling save()
Justin Meyer
@justinbmeyer
May 11 2016 20:25
@dbleier you make the algebra ignore that property
Well not ignore it
But able to know user:"dovid" matches path:'dovid/..'
Guido Smeets
@gsmeets
May 11 2016 22:14
hmm, how do I convert this 2.2 syntax to some 2.3 equivalent?
<my-comp foo="{{translate 'foo-label'}}" />