Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996186
async-foreach.ts
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
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
text/plain
Expires
Tue, Dec 24, 13:27 (20 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
554754
Default Alt Text
async-foreach.ts (361 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment