@opencvjs/web 4.10.0-release.1 → 4.10.0-release.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -55,6 +55,10 @@ const cv = await load();
55
55
  const src: OpenCV.Mat = cv.imread(imgSrc);
56
56
  ```
57
57
 
58
+ ## Example
59
+
60
+ [![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/fork/github/ocavue/opencvjs/tree/master/examples/web-vite)
61
+
58
62
  ## Credits
59
63
 
60
64
  TypeScript definitions are based on the [@techstark/opencv-js](https://github.com/TechStark/opencv-js) and [mirada](https://github.com/cancerberoSgx/mirada) projects.
package/lib/index.js CHANGED
@@ -1,5 +1,10 @@
1
1
  import cv from "./opencv_js.js";
2
2
 
3
+ let promise;
4
+
3
5
  export function load() {
4
- return cv();
6
+ if (!promise) {
7
+ promise = cv();
8
+ }
9
+ return promise;
5
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencvjs/web",
3
- "version": "4.10.0-release.1",
3
+ "version": "4.10.0-release.2",
4
4
  "author": "ocavue <ocavue@gmail.com>",
5
5
  "repository": "https://github.com/ocavue/opencvjs",
6
6
  "type": "module",