destroyData
Destroys a record in the collection.
function(instanceData)
Destroys an instance given the serialized form of the data. Returns any additional properties that should be added to the instance.
The following shows how constructor calls destroyData
and
what it does with the response:
// get its raw data
const instanceData = connection.serializeInstance( myInstance );
connection.destroyData( instanceData ).then( function( destroyedInstanceData ) {
connection.destroyedInstance( myInstance, createdInstanceData );
} );
Parameters
- instanceData
{Object}
:The serialized data of the instance.
Returns
{Promise<Object>}
:
A promise resolved with the destroyed data of the instance. The destroyed data.
By default, destroyedInstance deletes properties in myInstance
that are not in destroyedInstanceData
. To change that behavior, overwrite destroyedInstance.