File tree 4 files changed +11
-9
lines changed
4 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ npm install @dck/rescript-promise
81
81
82
82
Then, add ` @dck/rescript-promise ` to your ` rescript.json ` :
83
83
84
+ NOTE: For ReScript < 12 use 1.1.0
85
+
84
86
``` json
85
87
{
86
88
"bs-dependencies" : [" @dck/rescript-promise" ]
Original file line number Diff line number Diff line change 14
14
"url" : " https://github.com/aantron"
15
15
},
16
16
"peerDependencies" : {
17
- "rescript" : " >=11 .0.0"
17
+ "rescript" : " 12 .0.0-alpha.12 "
18
18
},
19
19
"devDependencies" : {
20
- "rescript" : " >=11 .0.0"
20
+ "rescript" : " 12 .0.0-alpha.12 "
21
21
},
22
22
"scripts" : {
23
23
"build" : " rescript build" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ type promise<+'a> = rejectable<'a, never>
5
5
type t <+ 'a > = promise <'a >
6
6
7
7
let onUnhandledException = ref (exn => {
8
- prerr_endline ("Unhandled exception in promise callback:" )
8
+ Js . Console . log ("Unhandled exception in promise callback:" )
9
9
Js .Console .error (exn )
10
10
})
11
11
@@ -133,7 +133,7 @@ module Js_ = {
133
133
134
134
let race = promises =>
135
135
if promises == list {} {
136
- raise (Invalid_argument ("Promise.race([]) would be pending forever" ))
136
+ throw (Invalid_argument ("Promise.race([]) would be pending forever" ))
137
137
} else {
138
138
jsRace (Belt .List .toArray (promises ))
139
139
}
@@ -265,7 +265,7 @@ let allOkArray = promises => {
265
265
switch result {
266
266
| Ok (v ) =>
267
267
resultValues -> Belt .Array .setExn (index , Some (v ))
268
- incr (resultCount )
268
+ Int . Ref . increment (resultCount )
269
269
if resultCount .contents >= promiseCount {
270
270
(values => resolve (Ok (values )))(
271
271
resultValues -> Belt .Array .map (
Original file line number Diff line number Diff line change 2
2
# yarn lockfile v1
3
3
4
4
5
- rescript@>=11 .0.0 :
6
- version "11 .0.0"
7
- resolved "https://registry.yarnpkg.com/rescript/-/rescript-11 .0.0. tgz#9a0b6fc998c360543c459aba49b77a572a0306cd "
8
- integrity sha512-uIUwDZZmDUb7ymGkBiiGioxMg8hXh1mze/2k/qhYQcZGgi7PrLHQIW9AksM7gb9WnpjCAvFsA8U2VgC0nA468w ==
5
+ rescript@12 .0.0-alpha.12 :
6
+ version "12 .0.0-alpha.12 "
7
+ resolved "https://registry.yarnpkg.com/rescript/-/rescript-12 .0.0-alpha.12. tgz#2d622e3ba6a97a737023f0d531a2748ab3719d64 "
8
+ integrity sha512-CffTYrWwg3x+iyYEUa8coaygjHcK7NH3CsqNKMvFDbZUxWWRi0JNnpFp01bfv1LdrHNIptmLgr7Df4a4FXSD5Q ==
You can’t perform that action at this time.
0 commit comments