# How to call async code in \`MatchHandler\` functions in Javascript runtime?

**URL:** <https://forum.heroiclabs.com/t/how-to-call-async-code-in-matchhandler-functions-in-javascript-runtime/5003>\
**Category:** Runtime Framework\
**Tags:** typescript\
**Created:** [February 28, 2024, 4:10am UTC](https://forum.heroiclabs.com/t/how-to-call-async-code-in-matchhandler-functions-in-javascript-runtime/5003 "2024-02-28T04:10:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oxiful](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/oxiful/32/2074_2.png) [@oxiful](https://forum.heroiclabs.com/u/oxiful)\
**Post date:** [February 28, 2024, 4:10am UTC](https://forum.heroiclabs.com/t/how-to-call-async-code-in-matchhandler-functions-in-javascript-runtime/5003/1 "2024-02-28T04:10:40Z")

</div>

I find myself having to do some async http GET/POST calls (to interact with a 3rd party API) during the match loop but the interface for `MatchLoopFunction` must return a ` {state: State} | null` which makes it not possible to return Promises even with `.then`.

What is the way to deal with this?
