Skip to main content

unsubscribeData

unsubscribeData

Releases a Provider Instance's real-time subscription. It sends a cancel request to the server and fires lifecycle events before and after the release.

Parameters

  • provInstName (String): The name of the Provider Instance to unsubscribe from

Returns: None (void)

Description

Ends a subscription started with subscribeData in the normal way.

Difference from cancelSubscribeData:

  • unsubscribeData: lifecycle events fire in the order onUnsubscribeDataBefore → server cancel sent → onUnsubscribeDataAfter
  • cancelSubscribeData: sends the server cancel immediately, with no lifecycle events

Both methods send a cancel message to the server.

Example

// 폼 종료 시 구독 해제 (이벤트 핸들러 활용 가능)
$vm.unsubscribeData("stockProvider");

Related

  • $vm.subscribeData(provInstName, callback) — start a real-time subscription
  • $vm.cancelSubscribeData(provInstName) — release immediately, with no lifecycle events
  • $vm.cancelAllSubscribeData() — release every subscription