Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 08:24

    greenkeeper[bot] on @webcomponents

    (compare)

  • 08:07

    greenkeeper[bot] on @webcomponents

    chore(package): update @webcomp… (compare)

  • Feb 27 17:39
    JuanFelix88 starred canjs/canjs
  • Feb 26 05:49
    hawk-ee starred canjs/canjs
  • Feb 25 18:23
    jxjxnyc starred canjs/canjs
  • Feb 25 14:59
    simondarke starred canjs/canjs
  • Feb 24 04:06
    BenitoJedai starred canjs/canjs
  • Feb 21 16:19
    cherifGsoul labeled #5427
  • Feb 21 16:19
    cherifGsoul labeled #5427
  • Feb 21 16:15
    cherifGsoul labeled #5433
  • Feb 21 16:15
    cherifGsoul commented #5433
  • Feb 21 15:53
    cherifGsoul labeled #5464
  • Feb 21 15:51
    cherifGsoul labeled #5465
  • Feb 21 15:51
    cherifGsoul labeled #5466
  • Feb 21 15:49
    cherifGsoul labeled #5467
  • Feb 21 15:45
    cherifGsoul labeled #5468
  • Feb 21 15:44
    cherifGsoul labeled #5468
  • Feb 20 20:57
  • Feb 20 20:42
    greenkeeper[bot] labeled #5469
  • Feb 20 20:42
    greenkeeper[bot] opened #5469
Kevin Phillips
@phillipskevin
see if it is the same thing you are doing @AntonProkofyev
Frank Lemanschik
@frank-dspeed
@phillipskevin couldn't he directly return the promis and don't use resolve?
i think he could simply return userConnection.get() ?
Kevin Phillips
@phillipskevin
he could, but it would make the template more complicated
and not fix this problem
Frank Lemanschik
@frank-dspeed
why would that affect the template
i always return pormis
and get directly the value
Kevin Phillips
@phillipskevin
you have to do user.value.name in the template
AntonProkofyev
@AntonProkofyev
mmm let me check
Frank Lemanschik
@frank-dspeed
hmmm i always do this each stuff for user.value
Kevin Phillips
@phillipskevin
@AntonProkofyev the way your code is, user.name is fine
Frank Lemanschik
@frank-dspeed
and that works great
ah
Kevin Phillips
@phillipskevin
you can do it that way, @frank-dspeed
Frank Lemanschik
@frank-dspeed
then i have no value when i use his code style
interristing
Kevin Phillips
@phillipskevin
using the async getter with resolve, you don't have to do it that way
user is the value if you use resolve
Frank Lemanschik
@frank-dspeed
but then i can also do no waiting like if isResolved right?
because i only get the value
i understand the diffrence is getting a promis or a value i understand
Kevin Phillips
@phillipskevin
right
Frank Lemanschik
@frank-dspeed
do you know a code that would allow me to change the value every x secunds?
Kevin Phillips
@phillipskevin
I usually do promises like this:
    userPromise: {
        get: function () {
            return userConnection.get();
        }
    },
    user: {
        get: function(last, resolve) {
            this.userPromise.then(resolve);
        }
    }
so you can do userPromise.isResolved and also user.name
in the template
Frank Lemanschik
@frank-dspeed
ah nice now i understand
why this is in some examples
i saw that :)
AntonProkofyev
@AntonProkofyev
yep that's what i saw in docs and i can see name when it's resolved...
i've add breakpoint but it gives nothing. just see that Object.defineProperty(map, "_instanceDefinitions", { make an error
and that map constructor is DefineMap
Frank Lemanschik
@frank-dspeed
but do you know a way to reset a value with a interval?
Kevin Phillips
@phillipskevin
@frank-dspeed use a setter
Frank Lemanschik
@frank-dspeed
how you mean that?
i have really no idea about that because for me a setter gets only called on set
and then you mean i can do var x = interval() in the setter
Kevin Phillips
@phillipskevin
foo: {
  value: 1,
  set(val) {
    setTimeout(() => { this.foo+=1 }, 1000);
    return val;
  }
}
Frank Lemanschik
@frank-dspeed
and it gets executed?
and that gets automatic executed?
does the setter get executed with value ?
Kevin Phillips
@phillipskevin
yeah
Frank Lemanschik
@frank-dspeed
ok ok
looks pritty cool
Kevin Phillips
@phillipskevin
@AntonProkofyev can you check what is propand value ?
and walk up the stack to the first place that is in your code
to see what is being called
AntonProkofyev
@AntonProkofyev
can you сlarify plz what you mean by checking what is prop and value
i can see that this defineMap appears somwhere near reflection/get-set
setKeyValue
Kevin Phillips
@phillipskevin
the parameters that function is being called with
AntonProkofyev
@AntonProkofyev
i can see that this defineMap is definening in can-stache-bindings.js in