Interval Cancellation
# Code\n```typescript []\ntype JSONValue = null | boolean | number | string | JSONValue[] | { [key: string]: JSONValue };\ntype Fn = (...args: JSONValue[]) => void\n\nfunction cancellable(fn: Fn, args: JSONValue[], t: number): Function {\n    fn(...args);\n\n    const interval = setInterval(() => fn(...args), t);\n\n    return function() {\n        clearInterval(interval);\n    }\n};\n```
['TypeScript']