Created
July 2, 2026 07:36
-
-
Save rasmusmerzin/fb93169b4d282ab43f3674efcd379e8e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| export function loopFunction<S, T>( | |
| fn: (this: S, item: T) => any, | |
| ): (this: S, ...items: T[]) => void { | |
| return function (this: S, ...items: T[]) { | |
| for (const item of items) { | |
| try { | |
| fn.call(this, item); | |
| } catch (e) {} | |
| } | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment