question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dot notation vs Ember.get behavior shift in Ember 3.2 from Ember 3.1.1

See original GitHub issue

This issue manifests in Ember 3.2 but not Ember 3.1.1

Imagine you have an instance of an Ember.Object (maybe a service), and on this instance you have an instance of another Ember.Object (perhaps a model), and this model has a property.

If model is isDestroyed: true, then the following occurs regardless of the value of property (e.g. it could be a computed, an ES getter, a simple boolean), the following behavior divergence below is observed.

service.get('model.prop'); // undefined
service.model.prop; // a value

Additionally, if prop has dependent keys, then the first call will error that you cannot set dependent keys, while subsequent calls will work.

service.model.prop; // throws error
service.model.prop; // a value

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Exelordcommented, Oct 2, 2018

It’s still valid case 😕

0reactions
rwjbluecommented, May 23, 2020

Parts of it are definitely still valid, though I don’t know that we are likely to change much fundamentally here.

I suspect the underlying issue is that once destroyed we won’t actually compute computeds, we will generally only return a previously cached value (if it had been retrieved before).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ember 3.1 and 3.2 Beta Released
Today the Ember project is releasing version 3.1.0 of Ember.js, Ember Data, and Ember CLI. This release kicks off the 3.2 beta cycle...
Read more >
Should I chain `get()`s in Ember, or can I use dot notation?
Can not remember where I read it on the ember site but they suggested the best solution was the dot notation. this.get('controller.
Read more >
ELI5 Full Stack Basics: breakthrough with Django & EmberJS
It represents a shift in my thinking as I take steps towards more complex full stack development. It also serves as an entry...
Read more >
@ember-data/store | Yarn - Package Manager
The core of EmberData. Provides the Store service which coordinates the cache with the network and presentation layers. ember-addon. readme. EmberData.
Read more >
Build An Ember.js App In 2019 For Beginners ! - YouTube
In this video I discuss how to setup an app for beginners with Ember.js Octane (the latest version of Ember.js). In this tutorial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found