diff --git a/text/0000-custom-model-classes.md b/text/0000-custom-model-classes.md index 3e133b567d..e6ae91c2b5 100644 --- a/text/0000-custom-model-classes.md +++ b/text/0000-custom-model-classes.md @@ -36,9 +36,9 @@ We will need five separate changes: - Replacement of few store methods that take DS.Models - Deprecate passing DS.Model classes to adapter/serializers/exposing them on Snapshots -## Instantiating custom Records +## Instantiating and destroying custom Records -First we need to expose a method on the store for instantiating a record, and way for the record to get notified when RecordData values change: +First we need to expose a method on the store for instantiating a record, a hook to be notified when a record is being destroyed for potential cleanup and a way for the record to get notified when RecordData values change: ```ts interface RecordDataWrapper { // proxies a subset of RD methods and hides the rest @@ -79,6 +79,8 @@ class Store { createRecordArgs: { [key: string]: any }, // args passed in to store.createRecord() and processed by recordData to be set on creation recordDataFor: RecordDataFor, notificationManager: NotificationManager): unknown + + willDestroyRecord(record): void } ```