Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a
delete
method and state on the @web5/api
Record
cla…
…ss (#635) This PR Allows a `Record` class to include a `deleted` state based on a `RecordsDeleteMessage` being applied to it. We update the `RecordModel` to reflect the immutable properties that a record may contain, as well as the optional mutable properties that are only relevant to a record that is in a non-deleted state. When a record is in a deleted state, it derives the immutable properties from the `initialWrite` of that record. Currently when dealing with a remote DWN, the user cannot be notified of a deleted state through a Query, however when Subscriptions are brought up to the API a user could receive a message from the remote which signals that the record has been deleted, more useful scenario testing will be implemented when `record.subscribe()` feature is added. - Implements a `delete()` method on the `Record` class that behaves similarly to `update()`. - Implements a `deleted` property on the `Record` class to indicate if the record is in a deleted state.
- Loading branch information