Skip to content

Commit 53c01f1

Browse files
committed
add test for lazy evaluation
1 parent a6c5411 commit 53c01f1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

jscomp/test/Import.res

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,8 @@ let eachInt = async (list: list<int>, f: int => unit) => {
1111
let each = await each
1212
list->each(f)
1313
}
14+
15+
let eachLazy = () => Js.import(Belt.List.forEach)
16+
17+
let eachInt = (list: list<int>, f: int => unit) =>
18+
eachLazy() |> Js.Promise.then_(each => list->each(f)->Js.Promise.resolve)

0 commit comments

Comments
 (0)