@clockworkdog/cogs-client-react 1.5.1 → 1.5.3

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.
@@ -4,6 +4,9 @@ const react_1 = require("react");
4
4
  function useIsConnected(connection) {
5
5
  const [isConnected, setConnected] = react_1.useState(connection.isConnected);
6
6
  react_1.useEffect(() => {
7
+ // The connection may have opened in between the useState initialization above
8
+ // and this useEffect logic running so use the latest state from the connection
9
+ setConnected(connection.isConnected);
7
10
  const handleConnected = () => setConnected(true);
8
11
  const handleDisconnected = () => setConnected(false);
9
12
  connection.addEventListener('open', handleConnected);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clockworkdog/cogs-client-react",
3
- "version": "v1.5.1",
3
+ "version": "v1.5.3",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -31,7 +31,7 @@
31
31
  "typescript": "^4.1.3"
32
32
  },
33
33
  "dependencies": {
34
- "@clockworkdog/cogs-client": "^1.5.1"
34
+ "@clockworkdog/cogs-client": "^1.5.2"
35
35
  },
36
36
  "description": "React components and hooks to connect to COGS to build a custom Media Master",
37
37
  "repository": {