Skip to content

Commit ff35758

Browse files
authored
Update destination functions - including variable scoping.md
1 parent a8b5a9d commit ff35758

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/connections/functions/destination-functions.md

Lines changed: 6 additions & 0 deletions
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, 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.
85+
86+
The handler for Destination functions is event-specific, for example, `onTrack()`, `onIdentify()`, etc.
87+
8288
### Errors and error handling
8389

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

0 commit comments

Comments
 (0)