Skip to content

Commit

Permalink
Update 0000-custom-model-classes.md
Browse files Browse the repository at this point in the history
  • Loading branch information
igorT authored Jun 19, 2019
1 parent fd76649 commit 47a6f8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions text/0000-custom-model-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
```

Expand Down

0 comments on commit 47a6f8c

Please sign in to comment.