I hereby claim:
- I am djsd123 on github.
- I am mikaelallison (https://keybase.io/mikaelallison) on keybase.
- I have a public key ASA77yyTBYxBH_ECuWHptzMYWVxHj9JcvyPMx-JojPPiwgo
To claim this, I am signing this object:
/* | |
I wanted a function that would only work once where all subsequent calls would result in a noop | |
I stumbled upon this Stackoverflow question: https://stackoverflow.com/questions/12713564/function-in-javascript-that-can-be-called-only-once | |
However, I found some of the answers difficult to implement in Typescript but on the bright side. I learnt a little about closures. | |
I added my simple workaround here: https://stackoverflow.com/a/72992927/2719085 and below. | |
*/ | |
let printName = (name: string) => { | |
console.log(name) |
I hereby claim:
To claim this, I am signing this object: