Closed mixonic closed 7 years ago
A reproduction appropriate for http://glimmer-playground.netlify.com/.
<div> <h1>Welcome to Glimmer!</h1> <p>You have clicked the button {{count}} times.</p> <button onclick={{action increment}}>Click</button> <br> Service#isMax: {{service.isMax}} <br> Component#isMax {{isMax}} </div>
import Component, { tracked } from '@glimmer/component'; class Service { @tracked isMax = false; } export default class extends Component { constructor(options) { super(options); this.service = new Service(); } @tracked count = 1; increment() { this.count++; if (this.count > 2) { this.service.isMax = true; } } @tracked('service.isMax') get isMax() { return this.service.isMax; } }
Expected: Both {{service.isMax}} and {{isMax}} will toggle to true after passing a count of 2.
{{service.isMax}}
{{isMax}}
true
Action: Only isMax toggles to true.
isMax
Replaced by https://github.com/glimmerjs/glimmer-component/issues/65
A reproduction appropriate for http://glimmer-playground.netlify.com/.
Expected: Both
{{service.isMax}}
and{{isMax}}
will toggle totrue
after passing a count of 2.Action: Only
isMax
toggles to true.