Skip to content

Commit d83d4a3

Browse files
committed
Refactor getOpenCv function to return an object for improved destructuring in main function
1 parent 417e3c9 commit d83d4a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ async function getOpenCv() {
2121
});
2222
cv = cvModule;
2323
}
24-
return cv;
24+
return { cv };
2525
}
2626

2727
async function main() {
28-
const cv = await getOpenCv();
28+
const { cv } = await getOpenCv();
2929
console.log("OpenCV.js is ready!");
3030
// You can now use OpenCV functions here
3131
console.log(cv.getBuildInformation());

0 commit comments

Comments
 (0)