Skip to content

Commit e0c3cd5

Browse files
authored
Merge pull request #7512 from sade-wusi/patch-7
Update destination functions - including variable scoping [DOC-1065]
2 parents 30dff1e + f0d1a42 commit e0c3cd5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/connections/functions/destination-functions.md

+6
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ To change which event type the handler listens to, you can rename it to the name
7979
> info ""
8080
> 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.
8181
82+
### Variable scoping
83+
84+
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.
85+
86+
The handler for destination functions is event-specific. For example, you might have an `onTrack()`or `onIdentify()` function handler.
87+
8288
### Errors and error handling
8389

8490
{% include content/functions/errors-and-error-handling.md %}

0 commit comments

Comments
 (0)