Skip to content
This repository has been archived by the owner on Mar 5, 2018. It is now read-only.

Cannot track a property on a referenced object #65

Closed
mixonic opened this issue Jul 6, 2017 · 2 comments
Closed

Cannot track a property on a referenced object #65

mixonic opened this issue Jul 6, 2017 · 2 comments

Comments

@mixonic
Copy link
Member

mixonic commented Jul 6, 2017

A reproduction appropriate for http://glimmer-playground.netlify.com/.

<div>
  <h1>Welcome to Glimmer!</h1>
  <br>
  Service#isMax: {{service.isMax}}

  <br>
  Component#isMax {{isMax}}
</div>
import Component, { tracked } from '@glimmer/component';

class Service {
  @tracked
  isMax = false;

  constructor() {
    setTimeout(() => {
      this.isMax = true;
    }, 2000);
  }
}

export default class extends Component {
  @tracked
  service = new Service();

  @tracked('service')
  get isMax() {
    return this.service.isMax;
  }
}

Expected: After 2 seconds both flags swap to true
Actual: Only the {{service.isMax}} changes to true

Replaces: glimmerjs/glimmer-application#87

@mixonic
Copy link
Member Author

mixonic commented Jul 6, 2017

A terrible hack of a work around:

@rwjblue
Copy link
Member

rwjblue commented Mar 5, 2018

This repo has been merged with glimmerjs/glimmer.js (into a monorepo setup). I am not sure if this issue is still applicable, but if you could confirm it is still an ongoing concern and open it over there that would be very helpful.

Sorry for the noise, but thank you for your help!

@rwjblue rwjblue closed this as completed Mar 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants