Skip to content

Commit 843fdca

Browse files
authored
Update source functions - include variable scoping [DOC-1065].md
1 parent a8b5a9d commit 843fdca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/connections/functions/source-functions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,12 @@ The `Segment.set()` method accepts an object with the following fields:
261261
> warning ""
262262
> When you use the `set()` method, you won't see events in the Source Debugger. Segment only sends events to connected warehouses.
263263
264+
### Variable scoping
265+
266+
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.
267+
268+
The handler for Source functions is `onRequest()`.
269+
264270
### Runtime and dependencies
265271

266272
{% include content/functions/runtime.md %}

0 commit comments

Comments
 (0)