useConnectedSlackChannels
The useConnectedSlackChannels hook is used to retrieve and manage Slack channels that are currently connected for a specific recipient object. This hook must be used within a KnockSlackProvider.
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 Slack 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 useConnectedSlackChannels hook to display and manage connected Slack channels.
Updating connected channels
#You can add or update connected channels by calling updateConnectedChannels with the new array: