Skip to content

Instantly share code, notes, and snippets.

@Zlatkovsky
Last active October 4, 2018 02:18
Show Gist options
  • Save Zlatkovsky/dd706c40431efabce962308789cba6f1 to your computer and use it in GitHub Desktop.
Save Zlatkovsky/dd706c40431efabce962308789cba6f1 to your computer and use it in GitHub Desktop.
Shared with Script Lab
name: StreamingCounter
description: ''
author: Zlatkovsky
host: EXCEL
api_set: {}
script:
content: |-
/** @customfunction */
function increment(
incrementBy: number,
callback: CustomFunctions.StreamingHandler<number>
): void {
let result = 0;
const timer = setInterval(() => {
result += incrementBy;
callback.setResult(result);
}, 1000);
callback.onCanceled = () => {
clearInterval(timer);
};
}
language: typescript
libraries: |
https://appsforoffice.microsoft.com/lib/1/hosted/office.js
@types/office-js
@types/custom-functions-runtime
office-ui-fabric-js@1.4.0/dist/css/fabric.min.css
office-ui-fabric-js@1.4.0/dist/css/fabric.components.min.css
core-js@2.4.1/client/core.min.js
@types/core-js
@microsoft/office-js-helpers@0.7.4/dist/office.helpers.min.js
@microsoft/office-js-helpers@0.7.4/dist/office.helpers.d.ts
jquery@3.1.1
@types/jquery
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment