js-data

Respect Your Data

Give your data the treatment it deserves with a framework-agnostic, datastore-agnostic JavaScript ORM built for ease of use and peace of mind. Works in Node.js and in the Browser.

Get Started

DS#hasChanges

DS#hasChanges(resourceName, id)

Synchronously return whether the item of the type specified by resourceName that has the primary key specified by id has changes.

Arguments
nametypedescription
resourceNamestringThe name of the resource to use. Unnecessary if using the resource directly.
idstring or numberThe primary key of the item to check.
Examples
var user = User.get(1); // { name: 'John', id: 5 }

user.author = 'Johnny';

// You may have to do store.digest() first

// same as store.hasChanges('user', 1)
User.hasChanges(1); // true

📘

Need help?

Want more examples or have a question? Ask on the Slack channel or post on the mailing list then we'll get your question answered and probably update this wiki.

Updated less than a minute ago

DS#hasChanges


DS#hasChanges(resourceName, id)

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.