-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: require Channel instance as the first argument to doSendMessage…
…Request (#2171) Avoid forcing integrators to recreate `Channel` instance from CID inside `doSendMessageRequest` and provide it directly as the first argument. BREAKING CHANGE: the first argument to `doSendMessageRequest` is now Channel instance instead of `Channel.cid`
- Loading branch information
1 parent
e8047f2
commit 2a06b88
Showing
4 changed files
with
31 additions
and
10 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
docusaurus/docs/React/release-guides/v11/doSendMessageRequest-signature.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
id: minor-breaking-changes-v11 | ||
sidebar_position: 4 | ||
title: Minor breaking changes 11.0.0 | ||
keywords: [migration guide, upgrade, breaking changes, v11] | ||
--- | ||
|
||
### Channel instance as a first argument to doSendMessageRequest | ||
|
||
The `doSendMessageRequest` will from now on be passed the `Channel` instance instead of its CID to avoid forcing the developers to recreate a reference to the `Channel` instance inside the `doSendMessageRequest` function. The developers should adjust their implementation of `doSendMessageRequest` to call directly `await channel.sendMessage(messageData, options)`: | ||
|
||
```ts | ||
import { ChannelProps } from 'stream-chat-react'; | ||
|
||
const doSendMessageRequest: ChannelProps['doSendMessageRequest'] = async (channel, messageData, options) => { | ||
// optional custom logic | ||
await channel.sendMessage(messageData, options); | ||
// optional custom logic | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters