From ff357584617ddb71d6cc1a36c6a4148e4f743fc4 Mon Sep 17 00:00:00 2001 From: Sharon Adewusi Date: Fri, 21 Mar 2025 14:23:07 +0000 Subject: [PATCH 1/3] Update destination functions - including variable scoping.md --- src/connections/functions/destination-functions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/connections/functions/destination-functions.md b/src/connections/functions/destination-functions.md index ae56dfd98f..dad4329980 100644 --- a/src/connections/functions/destination-functions.md +++ b/src/connections/functions/destination-functions.md @@ -79,6 +79,12 @@ To change which event type the handler listens to, you can rename it to the name > info "" > Functions' runtime includes a `fetch()` polyfill using a `node-fetch` package. Check out the [node-fetch documentation](https://www.npmjs.com/package/node-fetch){:target="_blank"} for usage examples. +### Variable scoping + +When declaring settings variables, make sure to declare them in the function handler rather than globally in your Function. This prevents you leaking the settings values across other function instances. + +The handler for Destination functions is event-specific, for example, `onTrack()`, `onIdentify()`, etc. + ### Errors and error handling {% include content/functions/errors-and-error-handling.md %} From 4fb3423fc01b62e6dd68e66ea4dcb1b6a0137b4a Mon Sep 17 00:00:00 2001 From: Sharon Adewusi Date: Fri, 28 Mar 2025 11:32:21 +0000 Subject: [PATCH 2/3] Update src/connections/functions/destination-functions.md Co-authored-by: forstisabella <92472883+forstisabella@users.noreply.github.com> --- src/connections/functions/destination-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/functions/destination-functions.md b/src/connections/functions/destination-functions.md index dad4329980..10a7298912 100644 --- a/src/connections/functions/destination-functions.md +++ b/src/connections/functions/destination-functions.md @@ -83,7 +83,7 @@ To change which event type the handler listens to, you can rename it to the name When declaring settings variables, make sure to declare them in the function handler rather than globally in your Function. This prevents you leaking the settings values across other function instances. -The handler for Destination functions is event-specific, for example, `onTrack()`, `onIdentify()`, etc. +The handler for destination functions is event-specific. For example, you might have an `onTrack()`or `onIdentify()` function handler. ### Errors and error handling From f0d1a42f6b0ba4d408159be2f6194aae561f4da7 Mon Sep 17 00:00:00 2001 From: Sharon Adewusi Date: Fri, 28 Mar 2025 11:32:28 +0000 Subject: [PATCH 3/3] Update src/connections/functions/destination-functions.md Co-authored-by: forstisabella <92472883+forstisabella@users.noreply.github.com> --- src/connections/functions/destination-functions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/connections/functions/destination-functions.md b/src/connections/functions/destination-functions.md index 10a7298912..f109a68a4a 100644 --- a/src/connections/functions/destination-functions.md +++ b/src/connections/functions/destination-functions.md @@ -81,7 +81,7 @@ To change which event type the handler listens to, you can rename it to the name ### Variable scoping -When declaring settings variables, make sure to declare them in the function handler rather than globally in your Function. This prevents you leaking the settings values across other function instances. +When declaring settings variables, declare them in the function handler rather than globally in your function. This prevents you from leaking the settings values across other function instances. The handler for destination functions is event-specific. For example, you might have an `onTrack()`or `onIdentify()` function handler.