Skip to content

Commit c5048b1

Browse files
committed
s~tracked-built-ins~@ember/reactive/collections~g
1 parent 5296883 commit c5048b1

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

guides/release/configuring-ember/disabling-prototype-extensions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ native arrays with things like a template's `{{#each}}` helper, Ember.js
4141
will have no way to detect changes to the array and the template will
4242
not update as the underlying array changes.
4343

44-
You can restore automatic tracking of changes by replacing your native array with a `TrackedArray` from the 'tracked-built-ins' library.
44+
You can restore automatic tracking of changes by replacing your native array with a `trackedArray` from [@ember/reactive/collections](https://api.emberjs.com/ember/release/modules/@ember%2Freactive%2Fcollections).
4545

4646
```javascript
47-
import { TrackedArray } from '@glimmer/tracking';
47+
import { trackedArray } from '@ember/reactive/collections';
4848

4949
class Ocean {
50-
islands = new TrackedArray(['Oahu', 'Kauai']);
50+
islands = trackedArray(['Oahu', 'Kauai']);
5151

5252
addIsland(newIsland) {
5353
this.islands.push(newIsland);

guides/release/in-depth-topics/autotracking-in-depth.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,12 +276,12 @@ Generally, you should try to create classes with their tracked properties
276276
enumerated and decorated with `@tracked`, instead of relying on dynamically
277277
created POJOs. In some cases however, if your usage of properties on POJOs is
278278
too dynamic, you may not be able to enumerate every single property that could
279-
be tracked. In this case, you can use `TrackedObject` from `tracked-built-ins`:
279+
be tracked. In this case, you can use `trackedObject` from [@ember/reactive/collections](https://api.emberjs.com/ember/release/modules/@ember%2Freactive%2Fcollections):
280280

281281
```js
282-
import { TrackedObject } from 'tracked-built-ins';
282+
import { trackedObject } from '@ember/reactive/collections';
283283

284-
let obj = new TrackedObject({
284+
let obj = trackedObject({
285285
a: 1,
286286
b: 2,
287287
})
@@ -291,29 +291,29 @@ obj.c = 3;
291291
```
292292

293293
All property reading and writing on this object is automatically tracked.
294-
`TrackedObject` is "shallowly" tracked. `obj.c = 4` would be tracked, but
294+
`trackedObject` is "shallowly" tracked. `obj.c = 4` would be tracked, but
295295
`obj.c.somethingDeeper = 5` would not be tracked unless you've also made sure
296-
that the contents of `obj.c` is itself another `TrackedObject`.
296+
that the contents of `obj.c` is itself another `trackedObject`.
297297

298298

299299
#### Arrays
300300

301-
When you want to track the contents of an Array, you can use `TrackedArray` from
302-
`tracked-built-ins`:
301+
When you want to track the contents of an Array, you can use `trackedArray` from [@ember/reactive/collections](https://api.emberjs.com/ember/release/modules/@ember%2Freactive%2Fcollections):
302+
303303

304304
```js
305-
import { TrackedArray } from 'tracked-built-ins';
305+
import { trackedArray } from '@ember/reactive/collections';
306306

307307
class ShoppingList {
308-
items = new TrackedArray([]);
308+
items = trackedArray([]);
309309

310310
addItem(item) {
311311
this.items.push(item);
312312
}
313313
}
314314
```
315315

316-
`TrackedArray` supports all the normal native `Array` methods, ensuring that
316+
`trackedArray` supports all the normal native `Array` methods, ensuring that
317317
their reads and writes are tracked.
318318

319319
## Caching of tracked properties

guides/release/services/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ Like any Ember object, a service is initialized and can have properties and meth
3333
Below, the shopping cart service manages an items array that represents the items currently in the shopping cart.
3434

3535
```javascript {data-filename=app/services/shopping-cart.js}
36-
import { TrackedArray } from 'tracked-built-ins';
3736
import Service from '@ember/service';
37+
import { trackedArray } from '@ember/reactive/collections';
3838

3939
export default class ShoppingCartService extends Service {
40-
items = new TrackedArray([]);
40+
items = trackedArray([]);
4141

4242
add(item) {
4343
this.items.push(item);

guides/release/typescript/core-concepts/services.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Let's take this example from elsewhere in the [Ember Guides][example-location]:
66

77
```typescript {data-filename="app/services/shopping-cart.ts"}
88
import Service from '@ember/service';
9-
import { TrackedSet } from 'tracked-built-ins';
9+
import { trackedSet } from '@ember/reactive/collections';
1010

1111
export default class ShoppingCartService extends Service {
12-
items = new TrackedSet();
12+
items = trackedSet();
1313

1414
add(item) {
1515
this.items.add(item);

0 commit comments

Comments
 (0)