Skip to content

Commit d28d3e9

Browse files
committed
Added comments to startService
Co-authored-by: Ulrich Neujahr <https://github.com/nobrackets> Co-authored-by: Bryan Chau <https://github.com/bchauu> Co-authored-by: Stephen Kim <https://github.com/stephenkim612
1 parent 4ae1cd7 commit d28d3e9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/src/components/bottom/CodePreview.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const CodePreview: React.FC<{
2323

2424
const ref = useRef<any>();
2525

26+
/**
27+
* Starts the Web Assembly service.
28+
*/
2629
const startService = async () => {
2730
ref.current = await esbuild.startService({
2831
worker: true,
@@ -58,10 +61,12 @@ const CodePreview: React.FC<{
5861
store.dispatch({type: "INPUT", payload: currentComponent.code});
5962
}, [state.components])
6063

61-
64+
/**
65+
* Handler thats listens to changes in code editor
66+
* @param {string} data - Code entered by the user
67+
*/
6268
const handleChange = async (data) => {
6369
setInput(data);
64-
6570
store.dispatch({type: "INPUT", payload: data});
6671
if(!ref.current) {
6772
return;

0 commit comments

Comments
 (0)