respondable-event 0.1.1-main.e92dc42 → 0.1.1
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 +1 -2
- package/package.json +21 -18
package/README.md
CHANGED
|
@@ -30,8 +30,6 @@ element.dispatchEvent(event);
|
|
|
30
30
|
// If `respondWith()` is not called, `checkResponse()`
|
|
31
31
|
// function will callback with `undefined`.
|
|
32
32
|
event.checkResponse();
|
|
33
|
-
|
|
34
|
-
const token = await authenticate.promise;
|
|
35
33
|
```
|
|
36
34
|
|
|
37
35
|
In the hosting page, the following code snippet responds with a token.
|
|
@@ -53,6 +51,7 @@ To reduce code complexity, the `checkResponse()` function guarantees the `callba
|
|
|
53
51
|
|
|
54
52
|
- If `respondWith()` was called, `checkResponse()` will return `true`.
|
|
55
53
|
- If `respondWith()` was never called, `checkResponse()` will call the `callback` function with `undefined`, and return `false`.
|
|
54
|
+
- Subsequent calls to `checkResponse()` will return `true`.
|
|
56
55
|
|
|
57
56
|
It is recommended to put `checkResponse()` immediately after `dispatchEvent()`.
|
|
58
57
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "respondable-event",
|
|
3
|
-
"version": "0.1.1
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Enables event listeners to send zero-or-one response back to the event dispatcher.",
|
|
5
5
|
"files": [
|
|
6
|
+
"./*.js",
|
|
6
7
|
"./dist/"
|
|
7
8
|
],
|
|
8
9
|
"exports": {
|
|
@@ -36,7 +37,7 @@
|
|
|
36
37
|
},
|
|
37
38
|
"repository": {
|
|
38
39
|
"type": "git",
|
|
39
|
-
"url": "
|
|
40
|
+
"url": "https://github.com/compulim/respondable-event.git"
|
|
40
41
|
},
|
|
41
42
|
"keywords": [
|
|
42
43
|
"event-target",
|
|
@@ -51,23 +52,25 @@
|
|
|
51
52
|
},
|
|
52
53
|
"homepage": "https://github.com/compulim/respondable-event#readme",
|
|
53
54
|
"devDependencies": {
|
|
54
|
-
"@babel/core": "^7.
|
|
55
|
-
"@babel/preset-env": "^7.
|
|
56
|
-
"@babel/preset-typescript": "^7.
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"jest": "^
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
55
|
+
"@babel/core": "^7.28.5",
|
|
56
|
+
"@babel/preset-env": "^7.28.5",
|
|
57
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
58
|
+
"@happy-dom/global-registrator": "^20.0.11",
|
|
59
|
+
"@happy-dom/jest-environment": "^20.0.11",
|
|
60
|
+
"@testing-library/react": "^16.3.1",
|
|
61
|
+
"@tsconfig/recommended": "^1.0.13",
|
|
62
|
+
"@tsconfig/strictest": "^2.0.8",
|
|
63
|
+
"@types/jest": "^30.0.0",
|
|
64
|
+
"babel-jest": "^30.2.0",
|
|
65
|
+
"esbuild": "^0.27.2",
|
|
66
|
+
"jest": "^30.2.0",
|
|
67
|
+
"nodemon": "^3.1.11",
|
|
68
|
+
"prettier": "^3.7.4",
|
|
69
|
+
"publint": "^0.3.16",
|
|
70
|
+
"tsup": "^8.5.1",
|
|
71
|
+
"typescript": "^5.9.3"
|
|
69
72
|
},
|
|
70
73
|
"dependencies": {
|
|
71
|
-
"respondable-event": "^0.1.1
|
|
74
|
+
"respondable-event": "^0.1.1"
|
|
72
75
|
}
|
|
73
76
|
}
|