useConnectedMsTeamsChannels
The useConnectedMsTeamsChannels hook is used to retrieve and manage Microsoft Teams channels that are currently connected for a specific recipient object. This hook must be used within a KnockMsTeamsProvider.
Parameters
#Accepts an object with the following properties:
The recipient object (with objectId and collection) to get connected channels for.
Returns
#Returns an object with the following properties:
Array of connected Microsoft Teams channels for the recipient object.
Function to update the connected channels for the recipient object.
Whether connected channels are being loaded or revalidating.
Error message if the request failed.
Whether an update operation is in progress.
Example
#Basic usage
#The following example demonstrates how to use the useConnectedMsTeamsChannels hook to display and manage connected Microsoft Teams channels.
Updating connected channels
#You can add or update connected channels by calling updateConnectedChannels with the new array: