DS#changeHistory

DS#changeHistory(resourceName, id)

Synchronously return the change history of the item of the type specified by resourceName that has the primary key specified by id. This object represents the history of changes in the item since the item was last injected or re-injected (on save, update, etc.) into the data store.

If id is not provided, return the change history for the whole resource.

Will throw an error if keepChangeHistory for the resource is false.

πŸ‘

You can call DS#changeHistory multiple ways

  • DS#changeHistory(resourceName, id)
  • Resource#changeHistory(id) - Where Resource was created by DS#defineResource
  • Instance#DSChangeHistory() - Where Instance is an instance of a Resource
ArgumentTypeDescription
resourceNamestringThe name of the resource to use. Unnecessary if calling changeHistory directly on a Resource.
idstring or numberThe primary key of the item for which to retrieve the change history. If not provided, return the change history for the whole resource.
Demo

πŸ“˜

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.