Skip to content

Commit e7df13d

Browse files
authored
Merge pull request #7513 from sade-wusi/patch-8
Update source functions - include variable scoping [DOC-1065]
2 parents b556826 + 552e45b commit e7df13d

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+
Declare settings variables in the function handler, rather than globally in your function. This prevents you from 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)