These are chat archives for canjs/canjs

3rd
May 2017
Gregg Roemhildt
@roemhildtg
May 03 2017 18:35
Does anyone know why a getter with get(val, set) set would be undefined?
The full getter looks something like this:
task_name: {
     get(val, set){
        if(val){ return val; }
        taskPromise.then((tasks) => { 
            set(tasks[0].name);
        });
    }
}
Michael Price
@web-mech
May 03 2017 18:38
it might have changed since i last looked if task_name is not bound, set will be undefined
Gregg Roemhildt
@roemhildtg
May 03 2017 18:39
Ah. Okay.
second sentence there describes this behavior
Eben
@eben-roux
May 03 2017 19:29
I am trying to use an api url in the format users/{id}/roles to get the roles associated with a user with the given id:
image.png
But I'm getting an error: steal.js:140 Potentially unhandled rejection [1] TypeError: Cannot use 'in' operator to search for '__get' in administrator
I have a suspicion that the algebra part may be where I'm making a mess. How do I do this. The id in the algebra part probably refers to the id of the actualy object returned but that does not actually have an id... just a rolename for all intents and purposes.
Michael Price
@web-mech
May 03 2017 20:41
@bmomberger-bitovi @phillipskevin could one of you look at this? canjs/can-util#261 . I made a few projects that use commonjs and not steal and this is breaking
Brad Momberger
@bmomberger-bitovi
May 03 2017 20:43
Looks like that was fixed today.
Michael Price
@web-mech
May 03 2017 20:43
ah no release was cut though
ok now i see 3.6.1. Thanks!
Brad Momberger
@bmomberger-bitovi
May 03 2017 20:44
:+1:
@eben-roux I looked into where that issue might crop up in can-connect and I suspect it's because the result of calling GET users/{id}/roles is an array of strings.
so if it's coming back like { data: [ "administrator" ] } you can't do an ID on the resource for a getList connection call.
Matthew Phillips
@matthewp
May 03 2017 20:48
@web-mech That's fixed
oh, yeah
Michael Price
@web-mech
May 03 2017 20:48
:+1:
Matthew Phillips
@matthewp
May 03 2017 20:48
we need to set up a linting rule to prevent that mistake
Michael Price
@web-mech
May 03 2017 20:48
agreed, i was just saying the same thing