Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-data-relationship-dirty-tracking

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-data-relationship-dirty-tracking

Dirty tracking for ember-data relationships

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ember-data-relationship-dirty-tracking

Dirty tracking for ember-data relationships.

Compatibility

  • Ember.js v4.4 or above
  • Ember CLI v4.4 or above
  • Node.js v14 or above
  • Ember-data 3.28 - 4.6

Installation

ember install ember-data-relationship-dirty-tracking

Usage

All relationships are tracked by default. After modifying a relationship, the model's hasDirtyAttributes property will become true.

Use the dirtyTracking option to disable dirty tracking for specific relationships:

// app/models/blog-post.js
import Model, { belongsTo, hasMany } from '@ember-data/model';

export default class BlogPostModel extends Model {
  @belongsTo('author', { dirtyTracking: false }) author;
  @hasMany('comment', { dirtyTracking: false }) comments;
}

Inverse Relationships

This addon does not support dirty tracking for inverse relationships.

Pick one side of the relationship to be the primary side. Modify the relationship from this side only.

Mark the other side of the relationship with dirtyTracking: false. Do not modify the relationship from this side.

For example:

// app/models/blog-post.js
import Model, { hasMany } from '@ember-data/model';

export default class BlogPostModel extends Model {
  // modify the relationship through this property
  @hasMany('tag') tags;
}
// app/models/tag.js
import Model, { hasMany } from '@ember-data/model';

export default class TagModel extends Model {
  // treat this property as read-only
  @hasMany('blog-post', { dirtyTracking: false }) blogPosts;
}

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 13 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc