Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F21589562
async-foreach.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
361 B
Referenced Files
None
Subscribers
None
async-foreach.ts
View Options
/* eslint-disable @typescript-eslint/no-explicit-any */
// warning - things might get executed out of order
export
default
async
function
asyncForEach
<
T
=
any
>
(
array
:
T
[],
fn
:
(
obj
:
T
)
=>
Promise
<
void
>
)
:
Promise
<
void
>
{
const
promises
:
Promise
<
void
>
[]
=
[];
for
(
const
element
of
array
)
{
promises
.
push
(
fn
(
element
));
}
await
Promise
.
all
(
promises
);
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Sat, Nov 7, 18:11 (12 m, 40 s ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1182079
Default Alt Text
async-foreach.ts (361 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline