Created
June 21, 2022 08:31
-
-
Save jiju-MS/e74da1b22153d4abcd80b65e8f4e0959 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function increment(amount: number, interval: any, invocation: CustomFunctions.StreamingInvocation<any[][]>): void { | |
var Entity1 = { | |
type: "Entity", | |
basicType: "Error", | |
basicValue: "#VALUE!", | |
text: "Entity 1", | |
properties: { | |
TestDouble: { type: "Double", basicType: "Double", basicValue: 1 }, | |
TestString: { type: "String", basicType: "String", basicValue: "Test" } | |
} | |
}; | |
var Entity2 = { | |
type: "Entity", | |
basicType: "Error", | |
basicValue: "#VALUE!", | |
text: "Entity 2", | |
properties: { | |
TestDouble: { type: "Double", basicType: "Double", basicValue: 2 }, | |
TestString: { type: "String", basicType: "String", basicValue: "Test" } | |
} | |
}; | |
let result = [[Entity1], [Entity2]]; | |
const timer = setInterval(() => { | |
Entity1.properties.TestDouble.basicValue += amount; | |
Entity2.properties.TestDouble.basicValue += amount | |
invocation.setResult(result); | |
}, interval); | |
invocation.onCanceled = () => { | |
clearInterval(timer); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment