Skip to content

Commit 443d00a

Browse files
committed
Work around the last of the uncurried issues. Fixes #22.
1 parent 013c6c7 commit 443d00a

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Added
2+
body: The `Event` module now includes 2 and 3 argument variants of `fromString` and `fromSymbol`
3+
for use ReScript 11 uncurried mode
4+
time: 2023-12-19T09:58:15.397871+11:00
5+
custom:
6+
GithubIssue: "22"

bsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,5 @@
2929
"warnings": {
3030
"number": "A-4-40-41-42-43-44+101-102-103",
3131
"error": "false"
32-
},
33-
"uncurried": false
32+
}
3433
}

src/Event.res

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,17 @@
2222
")
2323
type t<'listener, 'ty>
2424
external fromString: string => t<'a => 'b, 'ty> = "%identity"
25+
external fromString2: string => t<('a, 'b) => 'c, 'ty> = "%identity"
26+
external fromString3: string => t<('a, 'b, 'c) => 'd, 'ty> = "%identity"
2527
external fromSymbol: Js.Types.symbol => t<'a => 'b, 'ty> = "%identity"
28+
external fromSymbol2: Js.Types.symbol => t<('a, 'b) => 'c, 'ty> = "%identity"
29+
external fromSymbol3: Js.Types.symbol => t<('a, 'b, 'c) => 'd, 'ty> = "%identity"
2630
external unsafeToString: t<'a => 'b, 'ty> => string = "%identity"
31+
external unsafeToString2: t<('a, 'b) => 'c, 'ty> => string = "%identity"
32+
external unsafeToString3: t<('a, 'b, 'c) => 'd, 'ty> => string = "%identity"
2733
external unsafeToSymbol: t<'a => 'b, 'ty> => Js.Types.symbol = "%identity"
34+
external unsafeToSymbol2: t<('a, 'b) => 'c, 'ty> => Js.Types.symbol = "%identity"
35+
external unsafeToSymbol3: t<('a, 'b, 'c) => 'd, 'ty> => Js.Types.symbol = "%identity"
2836
type case =
2937
| String(string)
3038
| Symbol(Js.Types.symbol)
@@ -40,4 +48,4 @@ let eq = (event1, event2) =>
4048
| ("string", "string") => Obj.magic(event1) === Obj.magic(event2)
4149
| ("symbol", "symbol") => Obj.magic(event1) === Obj.magic(event2)
4250
| _ => false
43-
}
51+
}

test/module/EventEmitterTestLib.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ module Emitter1 = {
77
let symbol: Event.t<Js.Types.symbol => unit, t> = Event.fromSymbol(uniqueSymbol)
88
let text: Event.t<string => unit, t> = Event.fromString("text")
99
let integer: Event.t<int => unit, t> = Event.fromString("integer")
10-
let textAndInteger: Event.t<(string, int) => unit, t> = Event.fromString("textAndInteger")
10+
let textAndInteger: Event.t<(string, int) => unit, t> = Event.fromString2("textAndInteger")
1111
}
12-
}
12+
}

0 commit comments

Comments
 (0)