Current API makes creating a Promise with .pending, which is fine and wrap a callback with exec, which is fine.
I would like to propose a similar API as the new Promise, such as:
let make (fn : resolve:('a -> unit) -> reject:(exn -> unit) -> unit) : 'a Promise.t
Which might make Promise.pending a little less used/useful. Promise.make () will eventually make a pending promise, until resolve is being called internally.
Note: The same interface can be found for ReScript Js.Promise, for example.
Another change to the API that I wanted to propose is
s/Promise.resolved/Promise.resolve
In order to keep familiarity with the callback version and the JavaScript version.
Current API makes creating a Promise with .pending, which is fine and wrap a callback with exec, which is fine.
I would like to propose a similar API as the new Promise, such as:
Which might make Promise.pending a little less used/useful.
Promise.make ()
will eventually make a pending promise, until resolve is being called internally.Another change to the API that I wanted to propose is
In order to keep familiarity with the callback version and the JavaScript version.