Skip to content

Commit 0edfffb

Browse files
committed
update
1 parent 866f237 commit 0edfffb

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/Playground.res

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,12 +1253,11 @@ module OutputPanel = {
12531253
if type_ === "log" {
12541254
let args: array<string> = data["args"]
12551255

1256-
// Js.log(("args", arg))
12571256
setLogs(
12581257
previousLogs =>
12591258
previousLogs
12601259
->Belt.Option.getWithDefault([])
1261-
->Js.Array2.concat(args)
1260+
->Js.Array2.concat([args])
12621261
->Some,
12631262
)
12641263
}
@@ -1340,8 +1339,8 @@ module OutputPanel = {
13401339
->Js.Array2.map(log =>
13411340
<pre>
13421341
{log
1343-
->Js.String2.make
1344-
->React.string}
1342+
->Js.Array2.map(item => <span> {`${item} `->React.string} </span>)
1343+
->React.array}
13451344
</pre>
13461345
)
13471346
->React.array

src/common/RenderOutputManager.res

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ module Frame = {
2323
<head>
2424
<meta charset="UTF-8" />
2525
<title>Playground Output</title>
26+
<style>
27+
* {
28+
color: rgb(205, 205, 214);
29+
}
30+
</style>
2631
</head>
2732
<body>
2833
<div id="root"></div>
@@ -43,15 +48,14 @@ module Frame = {
4348
try {
4449
eval(event.data);
4550
} catch (err) {
46-
console.log(err);
51+
console.error(err);
4752
}
4853
});
4954
console.log = (...args) => {
5055
let finalArgs = args.map(arg => {
51-
if (typeof arg == 'object') {
56+
if (typeof arg === 'object') {
5257
return JSON.stringify(arg);
5358
}
54-
5559
return arg;
5660
});
5761
parent.window.postMessage({ type: 'log', args: finalArgs }, '*')

0 commit comments

Comments
 (0)