Preventing a function from being called twice in Typescript
Jun 1, 2021
When using Promises, there are times when we can’t be sure whether a long-running function has returned and is ready to be called again. In cases like these, we want a logic that says: “if this function has not returned, do not call it again.”
Luckily, this can be implemented through typescript decorators like so: