You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
davesnx
changed the title
Promise.pending/Promise.exec
Promise.pending/Promise.exec/Promise.resolved
Aug 15, 2023
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.
The text was updated successfully, but these errors were encountered: