Skip to content

Commit

Permalink
wrap more things
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Oct 15, 2022
1 parent 888f859 commit 7b32f6e
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
11 changes: 4 additions & 7 deletions packages/model/addon/-private/record-state.ts
Expand Up @@ -8,6 +8,7 @@ import { storeFor } from '@ember-data/store';
import { recordIdentifierFor } from '@ember-data/store/-private';
import type { NotificationType } from '@ember-data/store/-private/managers/record-notification-manager';
import type RequestCache from '@ember-data/store/-private/network/request-cache';
import { addToTransaction, subscribe } from '@ember-data/tracking/-private';
import type { StableRecordIdentifier } from '@ember-data/types/q/identifier';
import type { RecordData } from '@ember-data/types/q/record-data';

Expand Down Expand Up @@ -41,15 +42,11 @@ class Tag {
this.isDirty = true;
this.value = undefined;
}
@tracked _tracking = 0;

subscribe() {
this._tracking;
}
@tracked ref = null;

notify() {
this.isDirty = true;
this._tracking = this.rev;
addToTransaction(this);
this.rev++;
}
consume(v) {
Expand Down Expand Up @@ -86,7 +83,7 @@ export function tagged(_target, key, desc) {
const setter = desc.set;
desc.get = function () {
let tag = getTag(this, key);
tag.subscribe();
subscribe(tag);

if (tag.isDirty) {
tag.consume(getter.call(this));
Expand Down
1 change: 1 addition & 0 deletions packages/model/index.js
Expand Up @@ -19,6 +19,7 @@ module.exports = Object.assign({}, addonBaseConfig, {
'@embroider/macros',
'@ember/string',
'@embroider/macros/es-compat',
'@ember-data/tracking/-private',

'@ember/object/proxy',
'@ember/object/promise-proxy-mixin',
Expand Down
@@ -1,7 +1,7 @@
/**
@module @ember-data/store
*/
import { addToTransaction } from '@ember-data/tracking';
import { addToTransaction } from '@ember-data/tracking/-private';
import type { CollectionResourceDocument } from '@ember-data/types/q/ember-data-json-api';
import type { StableRecordIdentifier } from '@ember-data/types/q/identifier';
import type { Dict } from '@ember-data/types/q/utils';
Expand Down
Expand Up @@ -15,7 +15,7 @@ import {
DEPRECATE_PROMISE_PROXIES,
DEPRECATE_SNAPSHOT_MODEL_CLASS_ACCESS,
} from '@ember-data/private-build-infra/deprecations';
import { addToTransaction, subscribe } from '@ember-data/tracking';
import { addToTransaction, subscribe } from '@ember-data/tracking/-private';
import { Links, PaginationLinks } from '@ember-data/types/q/ember-data-json-api';
import type { StableRecordIdentifier } from '@ember-data/types/q/identifier';
import type { RecordInstance } from '@ember-data/types/q/record-instance';
Expand Down
2 changes: 1 addition & 1 deletion packages/store/index.js
Expand Up @@ -14,7 +14,7 @@ module.exports = Object.assign({}, addonBaseConfig, {

'@ember-data/canary-features',
'@ember-data/store/-debug',
'@ember-data/tracking',
'@ember-data/tracking/-private',

'@ember/application',
'@ember/array/proxy',
Expand Down

0 comments on commit 7b32f6e

Please sign in to comment.