> For the complete documentation index, see [llms.txt](https://ans-dev.gitbook.io/datareplicator/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ans-dev.gitbook.io/datareplicator/api-reference/client-side-api/stoplistening.md).

# :StopListening

Stops listening for updates for a specific `realKey`. This informs the server to stop sending updates for this key to this client and cleans up all local resources (cache entry and signals) associated with it.

It's a crucial practice to call this when a piece of UI is destroyed or a system no longer needs the data to prevent memory leaks and unnecessary network traffic.

***

**`DataReplicator:StopListening(realKey: string)`**

***

{% tabs %}
{% tab title="Parameters" %}

* `realKey`: [string](https://create.roblox.com/docs/luau/strings)

  The original data key.
  {% endtab %}

{% tab title="Example" %}
{% code title="StopListening.luau" %}

```lua
local scoreboardFrame = script.Parent
local TEAM_SCORE_KEY = "Public_TeamScore_Blue"

-- Start listening when the scoreboard is created.
local teamScoreSignal = DataReplicator:Listen(TEAM_SCORE_KEY)
local connection = teamScoreSignal:Connect(function(score)
	-- ... update UI ...
end)

-- When the scoreboard is destroyed, stop listening to free up resources.
scoreboardFrame.Destroying:Connect(function()
	connection:Disconnect()
	DataReplicator:StopListening(TEAM_SCORE_KEY)
	print("Stopped listening to team score updates.")
end)
```

{% endcode %}
{% endtab %}
{% endtabs %}
