@chromahq/react 1.0.5 → 1.0.7

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -149,7 +149,7 @@ const BridgeProvider = ({
149
149
  }
150
150
  });
151
151
  const bridgeInstance = {
152
- send: (key, payload) => {
152
+ send: (key, payload, timeoutDuration = 1e4) => {
153
153
  return new Promise((resolve, reject) => {
154
154
  if (!portRef.current) {
155
155
  reject(new Error("Bridge disconnected"));
@@ -162,7 +162,7 @@ const BridgeProvider = ({
162
162
  pendingRef.current.delete(id);
163
163
  reject(new Error("Request timeout"));
164
164
  }
165
- }, 1e4);
165
+ }, timeoutDuration);
166
166
  try {
167
167
  portRef.current.postMessage({ id, key, payload });
168
168
  setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chromahq/react",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "React bindings for the Chroma Chrome extension framework",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",