This is the latest docs version
Quick Links
  • -Overview
  • -Language Features
  • -JS Interop
  • -Build System
Documentation
Language Manual
Reference for all language features
ReScript & React
First class bindings for ReactJS
GenType
Seamless TypeScript integration
Reanalyze
Dead Code & Termination analysis
Exploration
Packages
Explore third party libraries and bindings
Syntax Lookup
Discover all syntax constructs
APIPlaygroundBlogCommunity
  • Playground
  • Blog
  • Twitter
  • GitHub
  • Forum
Js Module
Overview
Js
submodules
  • Array
  • Array2
  • BigInt
  • Blob
  • Console
  • Date
  • Dict
  • Exn
  • File
  • Float
  • Global
  • Int
  • Json
    • Kind
  • List
  • Map
  • Math
  • Null
  • Null_undefined
  • Nullable
  • Obj
  • Option
  • Promise
    • t
      t
    • t
      error
    • v
      make
    • v
      resolve
    • v
      reject
    • v
      all
    • v
      all2
    • v
      all3
    • v
      all4
    • v
      all5
    • v
      all6
    • v
      race
    • v
      then_
    • v
      catch
    • v
      unsafe_async
    • v
      unsafe_await
  • Promise2
  • Re
  • Result
  • Set
  • String
  • String2
  • TypedArray2
    • DataView
    • Float64Array
    • Float32Array
    • Uint32Array
    • Int32Array
    • Uint16Array
    • Int16Array
    • Uint8ClampedArray
    • Uint8Array
    • Int8Array
    • ArrayBuffer
    Typed_array
    • DataView
    • Float64_array
    • Float64Array
    • Float32_array
    • Float32Array
    • Uint32Array
    • Int32_array
    • Int32Array
    • Uint16Array
    • Int16Array
    • Uint8ClampedArray
    • Uint8Array
    • Int8Array
    • S
    • ArrayBuffer
    • Type
  • Types
  • Undefined
  • Vector
  • WeakMap
  • WeakSet
  • API / Js / Promise

    Promise

    Deprecation note: These bindings are pretty outdated and cannot be used properly with the -> operator.

    More details on proper Promise usage can be found here: https://rescript-lang.org/docs/manual/latest/promise#promise-legacy

    t

    RESCRIPT
    type t<'a> = promise<'a>

    error

    RESCRIPT
    type error = Js_promise2.error

    make

    RESCRIPT
    let make: ( (~resolve: 'a => unit, ~reject: exn => unit) => unit, ) => promise<'a>

    resolve

    RESCRIPT
    let resolve: 'a => promise<'a>

    reject

    RESCRIPT
    let reject: exn => promise<'a>

    all

    RESCRIPT
    let all: array<promise<'a>> => promise<array<'a>>

    all2

    RESCRIPT
    let all2: ((promise<'a0>, promise<'a1>)) => promise<('a0, 'a1)>

    all3

    RESCRIPT
    let all3: ( (promise<'a0>, promise<'a1>, promise<'a2>), ) => promise<('a0, 'a1, 'a2)>

    all4

    RESCRIPT
    let all4: ( (promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>), ) => promise<('a0, 'a1, 'a2, 'a3)>

    all5

    RESCRIPT
    let all5: ( ( promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>, promise<'a4>, ), ) => promise<('a0, 'a1, 'a2, 'a3, 'a4)>

    all6

    RESCRIPT
    let all6: ( ( promise<'a0>, promise<'a1>, promise<'a2>, promise<'a3>, promise<'a4>, promise<'a5>, ), ) => promise<('a0, 'a1, 'a2, 'a3, 'a4, 'a5)>

    race

    RESCRIPT
    let race: array<promise<'a>> => promise<'a>

    then_

    RESCRIPT
    let then_: ('a => promise<'b>, promise<'a>) => promise<'b>

    catch

    RESCRIPT
    let catch: (error => promise<'a>, promise<'a>) => promise<'a>

    unsafe_async

    RESCRIPT
    let unsafe_async: 'a => promise<'a>

    unsafe_await

    RESCRIPT
    let unsafe_await: promise<'a> => 'a
    Types and values
    • t
      t
    • t
      error
    • v
      make
    • v
      resolve
    • v
      reject
    • v
      all
    • v
      all2
    • v
      all3
    • v
      all4
    • v
      all5
    • v
      all6
    • v
      race
    • v
      then_
    • v
      catch
    • v
      unsafe_async
    • v
      unsafe_await

    © 2024 The ReScript Project

    Software and assets distribution powered by KeyCDN.

    About
    • Community
    • ReScript Association
    Find us on