DocsPlaygroundBlogCommunityPackages
  • Playground
  • Blog
  • Community
  • Packages
  • X
  • Bluesky
  • GitHub
  • Forum
Language ManualAPISyntax LookupReact

Syntax Lookup

Enter some language construct you want to know more about.
This is the await keyword.

Since 10.1

Use the await within an async function to unwrap a promise value in a seamingly synchronous manner.

Example

ReScriptJS Output
@val external queryMessagesApi: string => promise<string> = "global.queryMessagesApi"

let fetchMessages = async () => {
  let message = await queryMessagesApi("message-id-1")

  Console.log(message)
}

References

  • Async / Await

© 2025 The ReScript Project

About
  • Community
  • ReScript Association
Find us on