Skip to content

Commit fc04788

Browse files
committed
feat: upgrade rescript version
1 parent 2c8049d commit fc04788

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ npm install @dck/rescript-promise
8181

8282
Then, add `@dck/rescript-promise` to your `rescript.json`:
8383

84+
NOTE: For ReScript < 12 use 1.1.0
85+
8486
```json
8587
{
8688
"bs-dependencies": ["@dck/rescript-promise"]

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"url": "https://github.com/aantron"
1515
},
1616
"peerDependencies": {
17-
"rescript": ">=11.0.0"
17+
"rescript": "12.0.0-alpha.12"
1818
},
1919
"devDependencies": {
20-
"rescript": ">=11.0.0"
20+
"rescript": "12.0.0-alpha.12"
2121
},
2222
"scripts": {
2323
"build": "rescript build",

src/js/promise.res

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ type promise<+'a> = rejectable<'a, never>
55
type t<+'a> = promise<'a>
66

77
let onUnhandledException = ref(exn => {
8-
prerr_endline("Unhandled exception in promise callback:")
8+
Js.Console.log("Unhandled exception in promise callback:")
99
Js.Console.error(exn)
1010
})
1111

@@ -133,7 +133,7 @@ module Js_ = {
133133

134134
let race = promises =>
135135
if promises == list{} {
136-
raise(Invalid_argument("Promise.race([]) would be pending forever"))
136+
throw(Invalid_argument("Promise.race([]) would be pending forever"))
137137
} else {
138138
jsRace(Belt.List.toArray(promises))
139139
}
@@ -265,7 +265,7 @@ let allOkArray = promises => {
265265
switch result {
266266
| Ok(v) =>
267267
resultValues->Belt.Array.setExn(index, Some(v))
268-
incr(resultCount)
268+
Int.Ref.increment(resultCount)
269269
if resultCount.contents >= promiseCount {
270270
(values => resolve(Ok(values)))(
271271
resultValues->Belt.Array.map(

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# yarn lockfile v1
33

44

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==

0 commit comments

Comments
 (0)