Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Eben
@eben-roux
almost as if the method observes the change and then the change occurs in the method and then back to observing the change
lol
I'm sure you do
Frank Lemanschik
@frank-dspeed
if your defining a setter with a start value that returns a value
Eben
@eben-roux
if you have a fast enough machine then an infinite loop only takes 6 seconds to complete
Mohamed Cherif Bouchelaghem
@cherifGsoul
almost as if the method observes the change and then the change occurs in the method and then back to observing the change
Frank Lemanschik
@frank-dspeed

foo: {
  value: 1,
  set(val) {
    setTimeout(() => { this.foo+=1 }, 1000);
    return val;
  }
}
Mohamed Cherif Bouchelaghem
@cherifGsoul

what you mean by that

almost as if the method observes the change and then the change occurs in the method and then back to observing the change

Frank Lemanschik
@frank-dspeed
this will automatic infinty loop
and what cherif says is also right if you change the value the setter gets recalled and does what ever it does
Eben
@eben-roux
let me see if I can put together a jsbin to illustrate
Mohamed Cherif Bouchelaghem
@cherifGsoul
ok
Eben
@eben-roux
of course I cannot reproduce this with a simple jsbin :( --- typical
anyway, I worked around the issue
what I was doing was actually "sub-optimal"...
Frank Lemanschik
@frank-dspeed
ok
Eben
@eben-roux
using {{#if}} render components or not is actually not the best way to go
Frank Lemanschik
@frank-dspeed
i am happy that we could help you :)
the if thing works great
what else you can do ?
Eben
@eben-roux
it is way better, IMHO, to rather bind to a class attribute like hidden
Frank Lemanschik
@frank-dspeed
hmmm
i understand your issue :)
yes the hidden stuff is also ok
Eben
@eben-roux
I reckon something goes wonky with the binding since, in effect, all the bindings have to be broken down and rebuilt
Mohamed Cherif Bouchelaghem
@cherifGsoul
{{#if}}} render components?? you mean you have a condition to render a component?
Eben
@eben-roux
had the same issue with Ember
@cherifGsoul yip
so mainly I guess it would work ok
Mohamed Cherif Bouchelaghem
@cherifGsoul
it would work
Eben
@eben-roux
in some complex binding scenarios I can understand that a framework would get itself in a bind
but I'm probably buggering something up
so if the {{#if}} uses something that changes then it could get tricky
Frank Lemanschik
@frank-dspeed
@eben-roux it sounds ok for me else simply post your complet project on github
:D
Mohamed Cherif Bouchelaghem
@cherifGsoul
what about {{#prop}} <your-component/>{{/prop}}
Frank Lemanschik
@frank-dspeed
@cherifGsoul that sounds interristing never saw that
Eben
@eben-roux
in my case it seems as though the Promise I bind to within the if block ends up in a loop of the infinite nature
Frank Lemanschik
@frank-dspeed
what does that do what is prop?
does that check for boolen?
Mohamed Cherif Bouchelaghem
@cherifGsoul
@frank-dspeed checks if prop is defined
Eben
@eben-roux
my whole project is actually on GitHub... been there for quite a while: https://github.com/Shuttle/Shuttle.Sentinel
Frank Lemanschik
@frank-dspeed
hmmm ah hmmm but doesn't do if exactly the same?
Mohamed Cherif Bouchelaghem
@cherifGsoul
@frank-dspeed I dont remember exactely but has something with binding (computes)
Frank Lemanschik
@frank-dspeed
ok thanks i will look into that sounds interristing :)
Mohamed Cherif Bouchelaghem
@cherifGsoul
@eben-roux what is the template that causes the infinite loop?
Eben
@eben-roux
let me commit and I'll link to the code in question... not that you'd be able to tell from only the code
this is the template: