MCPcopy
hub / github.com/TanStack/ai / unsubscribe

Method unsubscribe

packages/ai-client/src/chat-client.ts:1112–1120  ·  view source on GitHub ↗

* Unsubscribe and fully tear down live behavior. * This aborts an in-flight request and the subscription loop.

()

Source from the content-addressed store, hash-verified

1110 * This aborts an in-flight request and the subscription loop.
1111 */
1112 unsubscribe(): void {
1113 this.cancelInFlightStream({
1114 setReadyStatus: true,
1115 abortSubscription: true,
1116 })
1117 this.resetSessionGenerating()
1118 this.setIsSubscribed(false)
1119 this.setConnectionStatus('disconnected')
1120 }
1121
1122 /**
1123 * Reload the last assistant message

Callers 3

injectChatFunction · 0.95
useChatFunction · 0.95
disposeMethod · 0.95

Calls 4

cancelInFlightStreamMethod · 0.95
setIsSubscribedMethod · 0.95
setConnectionStatusMethod · 0.95

Tested by

no test coverage detected