Open
Description
Background
Description
We currently don't describe well how to update tracked arrays and objects in Ember Octane. On Discord, now and then, a developer does ask how they can do so.
@tracked myArray = [];
@tracked myObject = {};
@action updateMyArray() {
// How?
}
@action updateMyObject() {
// How?
}
- In-Depth Topics - Autotracking In-Depth - Plain Old JavaScript Objects (POJOs)
- In-Depth Topics - Autotracking In-Depth - Arrays
- Upgrading - Tracked Properties - Plain Old JavaScript Objects (POJOs)
- Upgrading - Tracked Properties - Arrays
Possible TODOs
1. Arrays
- Create an example (the example may need to depend on the surrounding page context)
- Explain that Ember does not react to
this.myArray.push(...);
. - Explain possible solutions
- immutable approach
EmberArray
tracked-built-ins
2. Objects
- Create an example (the example may need to depend on the surrounding page context)
- Explain that Ember does not react to
this.myObject.myProperty = ...;
. - Explain possible solutions
- immutable approach
- native class
tracked-built-ins
3. Backport
Once the changes are approved for release
directory, backport the changes all the way back to Ember 3.15.
Questions
- We have 2 pages (Autotracking In-Depth & Tracked Properties) with almost similar content. Can one page refer to another?