awesome-react-repl
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -49,16 +49,20 @@ import React, { useState, useEffect } from "react"; | ||
useEffect(async () => { | ||
if (initiallyExecute.length === 0) return; | ||
const lines = []; | ||
useEffect(() => { | ||
; | ||
for (const execLine of initiallyExecute) { | ||
lines.push({ | ||
type: "input", | ||
value: execLine | ||
}); | ||
if (!execLine.trim()) continue; | ||
lines.push(await execAndGetLine(execLine)); | ||
} | ||
(async () => { | ||
if (initiallyExecute.length === 0) return; | ||
const lines = []; | ||
setLines(lines); | ||
for (const execLine of initiallyExecute) { | ||
lines.push({ | ||
type: "input", | ||
value: execLine | ||
}); | ||
if (!execLine.trim()) continue; | ||
lines.push(await execAndGetLine(execLine)); | ||
} | ||
setLines(lines); | ||
})(); | ||
}, []); | ||
@@ -65,0 +69,0 @@ return /*#__PURE__*/React.createElement(ReactReplView, { |
{ | ||
"name": "awesome-react-repl", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"main": "dist/ReactReplJS.js", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
@@ -42,11 +42,13 @@ import React, { useState, useEffect } from "react" | ||
useEffect(async () => { | ||
if (initiallyExecute.length === 0) return | ||
const lines = [] | ||
for (const execLine of initiallyExecute) { | ||
lines.push({ type: "input", value: execLine }) | ||
if (!execLine.trim()) continue | ||
lines.push(await execAndGetLine(execLine)) | ||
} | ||
setLines(lines) | ||
useEffect(() => { | ||
;(async () => { | ||
if (initiallyExecute.length === 0) return | ||
const lines = [] | ||
for (const execLine of initiallyExecute) { | ||
lines.push({ type: "input", value: execLine }) | ||
if (!execLine.trim()) continue | ||
lines.push(await execAndGetLine(execLine)) | ||
} | ||
setLines(lines) | ||
})() | ||
}, []) | ||
@@ -53,0 +55,0 @@ |
38900
565