Function useStartConversation
- useStartConversation(options?): {
error: null | Error;
isLoading: boolean;
startConversation: (<T>(peerAddress: string, content: T, contentType?: ContentTypeId, sendOptions?: SendMessageOptions) => Promise<
| {
cachedConversation: undefined;
cachedMessage: undefined;
conversation: undefined;
}
| {
cachedConversation: undefined;
cachedMessage: undefined;
conversation: Conversation<any>;
}
| {
cachedConversation: CachedConversation<ContentTypeMetadata>;
cachedMessage: undefined;
conversation: Conversation<any>;
}
| {
cachedConversation: CachedConversation<ContentTypeMetadata>;
cachedMessage: CachedMessage<any, ContentTypeMetadata>;
conversation: Conversation<any>;
}>);
} Parameters
Optional
options: UseStartConversation
Returns {
error: null | Error;
isLoading: boolean;
startConversation: (<T>(peerAddress: string, content: T, contentType?: ContentTypeId, sendOptions?: SendMessageOptions) => Promise<
| {
cachedConversation: undefined;
cachedMessage: undefined;
conversation: undefined;
}
| {
cachedConversation: undefined;
cachedMessage: undefined;
conversation: Conversation<any>;
}
| {
cachedConversation: CachedConversation<ContentTypeMetadata>;
cachedMessage: undefined;
conversation: Conversation<any>;
}
| {
cachedConversation: CachedConversation<ContentTypeMetadata>;
cachedMessage: CachedMessage<any, ContentTypeMetadata>;
conversation: Conversation<any>;
}>);
}
error: null | Error
isLoading: boolean
startConversation: (<T>(peerAddress: string, content: T, contentType?: ContentTypeId, sendOptions?: SendMessageOptions) => Promise<
| {
cachedConversation: undefined;
cachedMessage: undefined;
conversation: undefined;
}
| {
cachedConversation: undefined;
cachedMessage: undefined;
conversation: Conversation<any>;
}
| {
cachedConversation: CachedConversation<ContentTypeMetadata>;
cachedMessage: undefined;
conversation: Conversation<any>;
}
| {
cachedConversation: CachedConversation<ContentTypeMetadata>;
cachedMessage: CachedMessage<any, ContentTypeMetadata>;
conversation: Conversation<any>;
}>)
- <T>(peerAddress, content, contentType?, sendOptions?): Promise<
| {
cachedConversation: undefined;
cachedMessage: undefined;
conversation: undefined;
}
| {
cachedConversation: undefined;
cachedMessage: undefined;
conversation: Conversation<any>;
}
| {
cachedConversation: CachedConversation<ContentTypeMetadata>;
cachedMessage: undefined;
conversation: Conversation<any>;
}
| {
cachedConversation: CachedConversation<ContentTypeMetadata>;
cachedMessage: CachedMessage<any, ContentTypeMetadata>;
conversation: Conversation<any>;
}> Parameters
- peerAddress: string
- content: T
Optional
contentType: ContentTypeIdOptional
sendOptions: SendMessageOptions
Returns Promise<
| {
cachedConversation: undefined;
cachedMessage: undefined;
conversation: undefined;
}
| {
cachedConversation: undefined;
cachedMessage: undefined;
conversation: Conversation<any>;
}
| {
cachedConversation: CachedConversation<ContentTypeMetadata>;
cachedMessage: undefined;
conversation: Conversation<any>;
}
| {
cachedConversation: CachedConversation<ContentTypeMetadata>;
cachedMessage: CachedMessage<any, ContentTypeMetadata>;
conversation: Conversation<any>;
}>
This hook starts a new conversation and sends an initial message to it.