Skip to content

Commit

Permalink
Update docs to remove mention of hard deletes.
Browse files Browse the repository at this point in the history
  • Loading branch information
splindsay-92 committed Oct 25, 2024
1 parent dcd617b commit c86b4b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ The return of this call will be the deleted message, as it would appear to other
This is a _soft delete_ and the message will still be available in the history, but with the `deletedAt` property set.

```ts
const deletedMessage = await room.messages.delete(message);
const deletedMessage = await room.messages.delete(message, { description: 'This message was deleted for ...' });
```

### Subscribing to incoming messages
Expand Down
6 changes: 3 additions & 3 deletions src/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ import { Message } from '@ably/chat';

const MyComponent = () => {
const { send, get, deleteMessage } = useMessages();

const [message, setMessage] = useState<Message>;
const handleGetMessages = () => {
// fetch the last 3 messages, oldest to newest
get({ limit: 3, direction: 'forwards' }).then((result) => console.log('Previous messages: ', result.items));
Expand All @@ -208,14 +208,14 @@ const MyComponent = () => {
};

const handleDeleteMessage = (message: Message) => {
deleteMessage(message, { description: 'deleted by user', hard: false });
deleteMessage(message, { description: 'deleted by user' });
};

return (
<div>
<button onClick={handleMessageSend}>Send Message</button>
<button onClick={handleGetMessages}>Get Messages</button>
<button onClick={handleDeleteMessage}>Delete Message</button>
<button onClick={handleDeleteMessage(message)}>Delete Message</button>
</div>
);
};
Expand Down

0 comments on commit c86b4b1

Please sign in to comment.