{"_id":"use-sockjs","_rev":"45-d60258012b2388443edfcda3c3cfdff8","name":"use-sockjs","dist-tags":{"latest":"2.6.0","beta":"2.6.1-beta1"},"versions":{"1.0.0":{"name":"use-sockjs","version":"1.0.0","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@1.0.0","dist":{"shasum":"2e8c8541bfe260481e0360cd262dacf77152066f","integrity":"sha512-HX/iJNYdfUWYcLrMFsiu/EF44zGNb6hysNLVYee+17/MYuypYx/P+HHNGVgYOdgT4LJ4NxGkX2MN1Pp9k7ClDg==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-1.0.0.tgz","fileCount":11,"unpackedSize":4618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeejqICRA9TVsSAnZWagAAEMsQAJVDpEZIY3eKu+shFfPx\n8EvhY9T6yRl01S/YigpZBQk26yZv5VJN44tpgp2N6Etjazrfazz7R4ERbM5/\nvoK5owi5L7wYx+va1Du3Og6JEXoJUA+fxZPOqQSY2UhbXMKJTZljzumqJJhb\nAk5oXaal3QEv2EBDO0Q0sbvxpbILVAI6VURx6UrOqrnahTp24sbaVclJInHl\n+/mOanwN577v4jmR3kKFJqG9RB/bHYexquQWXwWkLW2gv+uwI9MvsSQna3QO\n00I2AOkdaf8BwL2DOAKvO4OBd4edoiN/SFFwXTL7YWYprDlL7CI7LjnIxKwU\nI2cdT0apadwo5JmArp0rqw42sOz6BN2W2MbcfiZc42W4aizX2BgYT5tzEWKa\ndOqZB3vMPImphA3c84KKiitslFEjrzO/Cnw93JZ8701j+a61N+7mWmNinqSl\nDgf2I2fS44Yuwv6JvegUGIqSDUUKZ0IqkoYpTlodx2wZgtqZThLoOZPMvi2K\nG5D8kf8mazT7bNsLxYzDpKGO+TM+o4blKSMWhbwUCuzpXqrOIMkT66Sq8uhH\nA3oryt9YnBLffMUYv1WQNU1Q7kOKpBsxuRFrj9MCFhc/ABgKf1Da+jvixy0V\n26gac+vlOnkLFBrGUhY5ApH0juGiNY20c6X3gJ/jNsYsZvJXvi1iER0y1EXd\nNIQj\r\n=uQ8i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDR+4T52aZRs+/VGpHySodW2KxzGRWPdkfz9FIWTDln2gIhAOKmvHOAP74qbUhm5WW5UyopiIiLoZ5qNjD/9YC4/xT6"}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_1.0.0_1585068680103_0.21731841387234274"},"_hasShrinkwrap":false},"1.0.1":{"name":"use-sockjs","version":"1.0.1","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@1.0.1","dist":{"shasum":"df2e99a6c5807e3eeb727011cacdaa272391feea","integrity":"sha512-uqthhAwO7KdjyZoYDtFA95Tdgt2Pyp28vxVTQchz3kgcqtDdPwfRy1MMzRhPck1IK2uHB4J7BJI4xq+Ln/SKAw==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-1.0.1.tgz","fileCount":20,"unpackedSize":7947,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeejy8CRA9TVsSAnZWagAAeXUQAIebzio1sOX/Nun2qC4B\nXCmWkHgKNoizInbhf7aOmzwih7+FplpEW2J/4AncYMjWRztxISb0dB9p3WVM\n0C4b3mun98Sh/NB7jnFp01ak6f7qJFsS7ivezBNjKpyaihPn55aUr2tJAcm9\nFK+XN5YXIVBrj7jebrDfNg4QSn9dxviLrJiRb9hky5u7FHVHywhZXR0nUbHa\nNnVkhhvEZ/aEptHdDtAIXwaHJwyIO6N6b2xqm6+N3AHxELru70BszwbuoyRq\naeynHAlwQq9T8n8dOePMyhH+bjD3B4jJMkX6fXVe7DvjzmtSQCvo1r6sP8p9\nqZwnKLu2KSmnoMrl9FqmDBTMOIcgyEE94jhowoi2EEDZVhs1kvvP9c4sUGtG\n+Q7hEwn/hCPYRPVSsNu1jkS+3MgX0fbFa7qA2FsAmGqnTlEgOrj45xWduA1n\nkDT3AgFyKvAmF7B3A1EL7tp4j91moStQ0vbTHcaEwrQo9ugQY7LULFcFcAJ+\nHGsdXQ9GHl5p0UqjeecSnHHx18GtPrRcWrXfaf1tHYNB9VCVhf+wwZys/PCd\nDa6TqYZpxTs7nntpAOraAWv2CTP+C/IPactOATGfXCeF9n4lPNvfCeJgRpKE\nBsurBpzQHoB/ZFfePSGgOzpt7Kap4EHmDcQwZUCluZIa4+ECa5M8CZjHbLyh\n1yWE\r\n=eL8V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8UmLnEO0MG5Xr6nvlc0rDhwNrgZvAzL18/PrSYWHBSwIhALN2AnYJXxn2rS/D87oAjy5Wd4YOq0nsgLS2ZCMXrlk4"}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_1.0.1_1585069244350_0.6965052078477392"},"_hasShrinkwrap":false},"1.0.2":{"name":"use-sockjs","version":"1.0.2","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@1.0.2","dist":{"shasum":"6904c95ae05f7222123a18c025f1046a2394969d","integrity":"sha512-c0pGJWn+Z6VuQxkLVFz7sMETYGaClfp72z1yQ30uV50GLXRusOg5tGWHMkLW+ylFjZrxHcmxCuVJToNedddqNQ==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-1.0.2.tgz","fileCount":20,"unpackedSize":8268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJenVPQCRA9TVsSAnZWagAAsv8QAKBrFcLSf/A4leTxhS7c\nGEsRb2BPGRzAFUrWGC1AdYmbX4sMeb/wH0Iwd3kzUJ9Fd/tbalLQDFSbmKrA\nwBavrs5/updsMHY88LPyGLE2m/ALzntZiwEEbdtjYL53svP9pM1iUX2A6Veb\ntd79l2tJA4i8UdvnLljJh8LT7vqZ5dH3zBJrcBwcAlovC3HbgYPOuoSLjb/p\nCLKEbHnVXwiOWIivczDVGm80KWu3qJyojiQyD+w0FNuZOakFRM34BKiZBXAd\n9VRB5+p9W0NEeJDP5MNJfgUG6aOrgyLrMXQb8Aqb+759eRUtFiBVZDrsrBGK\n3TraNYXO5/cd6SRxYP3ASajHEE/xSdie+GxDRoSqpOvKw0ivXQuTcJOUPnXI\nQeY9b5lFGtZ4l885e2CCalS2pRzzrONbAN/h+TrHC65nu8+w/AYFqIQR5VvF\nEXHm3Gcc5X1BynWD3u+Lc7Rl7LtiuIhTy73DsIipfdF8mF6+xzMReJC00mv0\nQT895tMNf/eFWew3lsk/vLeaTfZIPJ7MQDrSHljAS2Wi/R8j4kXfSEDQN4xN\nXSgIJ5E1l37rzOGiwkLJAdANN3h3vZPyFNBorzqEQSPdGK66QLet3puUtfbN\nWarUa5UNnQP5E2/LV8mns8DmsYCJK9yPLOE9Dn0WMOKDPcLNx1TUNI/iKLyC\nVr4B\r\n=TBQC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/sWtrjixNVx3YwWMYN84hMsh4kevAXFyEipaF9uIW6AIhAN+D8oxU4e+kXZl/1UjHKQ0wnAr/QxiYUiZOiWLIk4oY"}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_1.0.2_1587368911544_0.5263107283623876"},"_hasShrinkwrap":false},"1.0.3-beta1":{"name":"use-sockjs","version":"1.0.3-beta1","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Usage\n\n```shell\nyarn add use-sockjs\n```\n\n```typescript\nimport { useSockJs } from 'use-sockjs'\nimport { Frame, Message } from 'stompjs'\n\nuseSockJs({\n  url: `http://localhost:8080/websocket`,\n  topic: '/user/queue/messages',\n  headers: {},\n  subscribeHeaders: {},\n  onMessage: (message: Message) => {},\n  onError: (error: Frame | string) => {},\n  debug: true\n})\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@1.0.3-beta1","dist":{"shasum":"79ac6f8996fefbba0ceb77bbde075a4c438ed41f","integrity":"sha512-dlC3OhhIBjkJYIzJcLe0uuRZqgrF6Ysl9s3KicaIjzV/K+Lbz5nllgAq9KXjYLL1d08fjdREGcrv1stKkCYn3g==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-1.0.3-beta1.tgz","fileCount":20,"unpackedSize":8267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen+/rCRA9TVsSAnZWagAAlgcP/jXFWZCDJJS8sCnBb3I2\n/y+r9O7S3ftOPY93iOM9S66bYiatJT3MBLdvt+z2bkIDgtTs7c+r6Hqbe4Ob\nAFjdnW7JwY98v1JUI9ra7sPx1HsPxLZ+d1hxZIgUilTd1QnBhI2zN5QG0ebn\nil7WR10vs4DZs8uY7DyKNgHquNtLyvTfwDAvI6aFiweKULLqxVkc6A3vUxmd\nWc3ZbIxSKS1fUxaD4xpqIJkB1/NtwiGiGR4+Bew/+Fkxjmg81zTaiLvm0s4L\nco/ust0Ms8PPd4m1+vIOXuLudLRO88OvQhqoVKG3Q99xdPLNH1cyJ371Akpu\n0qmiT22r+8d5ygFJgUDHTfgYuS0yAAKzUFDdtDL4RDsKUgCd025WWHjk4pYE\nJ5FlSgWDGk4HKgkTYXVi78RWB29rMtnQxVyclF7y84UYBFuL92MuwXmxaoHM\n2zWixWFQbWm5UlJFxrEzDgGuEUbCGwP3jW94U4izOgLnPxcPOo1jMzekRs2Z\nGneH4RST4UMZox82YI81tQapQ/cUnqqcii9crRpb9Pz+IFPt6iNT6jxMCOfB\ncv4gpedtr4hcTUTXXwNBADPdeGnS23Y2ZwUHkHL+JDlGsHOi+hWDFY5lmcCU\nMdwvxM2kvCGRMQsFnl16YBwf9LrEfLpKlMn/N8zE5JmCgPdT4gMc6OuXtZS/\nCMTp\r\n=ERn7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNvgvHfM6errgiP5znc2l9WwO5vNTsTRZ+RDgLDZNC9wIgRjrjtjR+6XZlDkqYWmzK7lsAHY+ILQjHsbvsQQwO/Xw="}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_1.0.3-beta1_1587539947039_0.004872971359729306"},"_hasShrinkwrap":false},"1.0.3":{"name":"use-sockjs","version":"1.0.3","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@1.0.3","dist":{"shasum":"3f8c654255bc136a423ccf520105f9e0eebeaf28","integrity":"sha512-W0dwQ64rJ7JBx8B+mmHA7PlGTPymASJmvLYzjyZeK9ZyzxO0mgcjYefY+cyvIuzRPSMMKBE99NUV+FYmMrIkDA==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-1.0.3.tgz","fileCount":20,"unpackedSize":8261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJen/R4CRA9TVsSAnZWagAAcbcP/jPDfz9kKXTg/30uOqXw\nV83fO7YRJWcGOQL/Jj8KSUl4+Dr5ekPII+vLCqoM6IPtcg+jqzaeZmaNTi2A\nhgqNEgbpap9mFRwNg7GO8c9kHocbQ31rttQx5NjQ6fRWYKawDdQja2e4aoe/\nUtNSJ+WttNzoUaUImqLlGFMGd7n8Q4H8ipfQihY0ApJO92RAkyQzyapUclu8\nhrGiX3qdAblaKtgwY+/q+ew4CDr7MN27m1N8PX7mb46Peehgl/Hvc30ADNTk\nOaWwmyCLce/jCcKdvMe4W0E5SMif3Vc1wqXXRAtUNZL011v7tPJOcnGrrk1Q\ns7aFJb9+IKfkQRl9wJHBOPr3XSGo23duKDhcnjsuXR4uowOXCJV2rlr7d2fH\nbOL/j2ynZJdVjPXiI3XhoO3AJmUK6X/37S3fb4f5ehfR0uYDqhiNeKB2zkFr\nsCSH0jbRdiBsM257cS0pYL6DNN7+BOZRxWgHz8MMqww8S4wd14RjI6TEB0jP\n7+HuXzMI/nwK62z0n/U6Xxa5JaFPS4EHICfrXz/ocOvUi0DqpnQiYJpLv4L9\nPATSlL+56jh+r4BhbNARRLQhBQtPYfiwcmXaN1MCpRAKqIhc7jr6YX0E2UKG\nAQcHSpeKB0Ztc7JFTRvwzdUIjz2R/kWUe53hJASphEG6fIHLz8Bss4RkxO+9\numrJ\r\n=iv8R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0+SVYDExHCV04ikYpJKfTp4fqUOEbfdxclxg0giuSkAIgBu+OlrSKu15fJqk7mr5ELrJvIKmDZWaAl11St6f/IVI="}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_1.0.3_1587541112247_0.763257941411255"},"_hasShrinkwrap":false},"1.1.0":{"name":"use-sockjs","version":"1.1.0","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@1.1.0","dist":{"shasum":"e971dc1e5a6f8954a79fe271e74e47b7d19cc03d","integrity":"sha512-Bfj4gWvagg5aPpKOQpBS+saOUxFM9kt2+3CoO5pDBbDwED6qyHPEMCA9f4yLh2SQPRwwAOuKU70QxFl15TW3pw==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-1.1.0.tgz","fileCount":20,"unpackedSize":9039,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe8cHXCRA9TVsSAnZWagAA26sP/RHGXNM9WVSiKUnX7O/3\nmItEe46GItWR428RK59EBautyWIKc2u07FY1k2RblQB7Qb2t8LmErI1uv8SU\nmmL2Ndq9elUQgUbU6MyzLr8ddSveindv5t3jbesFPguX/IWsgTznwoUCOi0j\nSaZhQQmrv2V0jFyi37QrNW8WZOzw+7W8yd9qvgFKrz6ewzyjDKBLuoYVQwVW\nt3xLvE8ZA9iG2TCrURWaSSL7Js/3hVEbmXF6a/A+xXtFlz1eODnlsbxPXnP1\n19fT4j8Gfbc7zv7ds5E9+7yI2TzzFSeHL2lDcC69wc7ebsHeTdFwvmOTA5+m\nj0RfnMejXdilgHQ6ylu+XRER0fzYZ5oyuZQUW5BN8JZ5tg1jzCYVL1yqlbh9\nsuw3Hv3/Yq902uc/TuQUHe/1n2w8fw5KTQi00uGzHwh7gH+jjq34kWaG0wWE\nrakXlPL3fnfTgqdbKKtX+jFaOIKwhLZ4SnCAwCV1LMVjJHGWmLIqsBuoc1ak\nv+myz2yVzxkS+MX/VAn90EoJHrZ0+p16qg8tue2pQkc1dK9QTGGhMwdsIUJl\nZm3DaI2DXiI0mBd821pM7AZcjXS7xEmV9ay21QRPIRmcPcFR7S3XBD47WgkU\ncDL+vHrQIuDY00VZSZkuxdPmHhEcN8BC8wWFNLI7NiHoxcRbd0pXE7lUr0cC\npClm\r\n=Wp6d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAoSjrB22ZPE5cr4zzk6qz6U777DWvIb4gTIjHtGetX1AiEA/hwtGKjhWmiIYD14wDGOjmSGOOblEfGWXNrKHaaK6O4="}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_1.1.0_1592902103066_0.5390784127386918"},"_hasShrinkwrap":false},"1.2.0-beta1":{"name":"use-sockjs","version":"1.2.0-beta1","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Usage\n\n```shell\nyarn add use-sockjs\n```\n\n```typescript\nimport { useSockJs } from 'use-sockjs'\nimport { Frame, Message } from 'stompjs'\n\nuseSockJs({\n    ready: true,\n    url: `http://localhost:8080/websocket`,\n    header: {},\n    onConnected: client => {\n      client.subscribe('/topic/topic_name', message => {\n        console.log(message)\n      })\n    },\n    onDisconnected: () => {\n      console.log('onDisconnected')\n    },\n    onError: error => {\n      console.log(error)\n    },\n    debug: true\n  })\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@1.2.0-beta1","dist":{"shasum":"90d3bd44596fd1c484ae716b1862ac2a650f9417","integrity":"sha512-aicPij01YglWByH4ex10DRBUuHd5fsLQcKkW0JHr4OJLdorFHL0dOCMyVmXFTf8x3mH/ZYYhQPUx6HaVjlT1sA==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-1.2.0-beta1.tgz","fileCount":30,"unpackedSize":19836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfCz8NCRA9TVsSAnZWagAAo3wQAJNXTcYDwFitqag4GvgQ\n3lFmSm7Fhg5V6RELbIHbT0M6BtlYkdzQGqu6Lp2/8MDaPMgQ71ZK00uOCoZf\nTMQ3umUYN4ViODBHOXesHIHqSnTRj9xWYoLUQQPGO++wEN1mJ0kofyrGJ9n7\nIXSUe31+HWY4+i0msNqTRTThq+EpNavWIYW5u3cjd0g66HDumbhpcc+6PS14\nQXyhnUkJ8v5XZLyrgLMlAAk820cgy0AiDW7Gf7VszdWEBXv2cE5frkjun3RN\n0VjNFp5Kpae4vbBWV9H0WdKYEeMwW6DUdTnY8fmI2YMV6Ks90i4RBa+gQZM8\nnvfUFIpn3Qknwz+XDQqeghdmRfGFRSTaZ/JaBvD2B0UQmLmamkTcLBswEKJX\nZCh4Oy0f5vaLwEyqINHsOLL724+zNyJOxYfe9uRr+QNWLZUltF/42xm+KLCu\nCpOxMJI5tM98d5Pe/FLToN1OAoaywRIHLyQIFuG36IfGrkmN7AyE33v+L9ga\nznyKydXjseP822YnWX5fbX0/iTU2WM1W9Y3uZUUIoTWSJRk4Qers6zbHZEnw\nT3FEqto2EGd77KvYykPGTyY/V8qHdCiy8a5S08MG9k3eI3C5wL8KZREQZpja\nde4defHlja2gQW0uJlKuHJrJs/MLya2JvFmXTtQGcHKfIbs9gX6IwnRUEnlM\ncbLm\r\n=fum1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfvcaCxP/Vy8TNuZkshALc/W6bR/JLU8ORh9CjSb89EwIhAJmcNETAgLO3SipblmUlOf17sbNBjpK6a2EVfKOpfPXu"}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_1.2.0-beta1_1594572557463_0.6175886543535412"},"_hasShrinkwrap":false},"1.2.0-beta2":{"name":"use-sockjs","version":"1.2.0-beta2","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Usage\n\n```shell\nyarn add use-sockjs\n```\n\n```typescript\nimport { useSockJs } from 'use-sockjs'\nimport { Frame, Message } from 'stompjs'\n\nuseSockJs({\n    ready: true,\n    url: `http://localhost:8080/websocket`,\n    header: {},\n    onConnected: client => {\n      client.subscribe('/topic/topic_name', message => {\n        console.log(message)\n      })\n    },\n    onDisconnected: () => {\n      console.log('onDisconnected')\n    },\n    onError: error => {\n      console.log(error)\n    },\n    debug: true\n  })\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@1.2.0-beta2","dist":{"shasum":"4af4d46136beb19e34a975e46e249199f97f5c82","integrity":"sha512-MKLpF6p7apHjYFOIc+n+jJzq23qQEEcl6LKU+k5jZ7DKIhjH76SQnLqkk52+X0qAMqj8JSthRlGDfgt/ergzoQ==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-1.2.0-beta2.tgz","fileCount":30,"unpackedSize":19814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfC0q7CRA9TVsSAnZWagAAo0sP/AqIlzsOHiohOS9RlLRU\ntE13IlOM0LYqCSroYD07G+KrpdphFSJGjFFCxPl/mqwL8/qPG6XGNHgXYBOT\nIWPbJg4zQxNm0ZmqQ8LfgPL8CFyTLIFudHgbZn0pBEyJh35KakUGV2+z4n+P\nfZ7EoPQY/9emvTC6AGPNqUKsfDtBW0pOsDuXb9fLlqINE1hZj1fgHgbCPPM4\nmYsreoo4tPJugbMcBsrqtBnlOBsoeBF86IcBHp8eT1uJ71g9KymJ0T/qgDxy\nq1mKOobsCo6NqP4AGnyrCGaYoWECgmp5RLqmoRmOYlJeZVxTg1KVAdbVaZy8\nG9rt8DO70t57/PUVL0ehu7jadEz9RfSMvfFtOkwpUFSTcrKUq0O8O2+MJdVA\nKOgUrhc2QLD8zq+NDGwLh69km9F3TZ6TKvEamqU8wAw+xTGFyxvRheBjQS04\nVBwuErKgVo4R7YQYu32yF9iqMSNrhgzcqe+QEHENHiV+oCbL24do8dm06Qh7\nA303HKO4ZCTI1Yk4QwTwmPp0YKDVTtoOEkFu8NpK05Yu+J3q0AkBQenRNRaq\njrvEZbg8HMl0Tif2nH98JBm3TBcRwkXFW8CtGdkutW3uRvkivXNMjTW/FIei\nqDonAVy7oYl+etl1Hhj5yboKbrJVoaQdYwQYb0qFwZVxE0zRZC907iwXUGh3\nsgl9\r\n=45/z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD6KYEMhRH2v3XZ5NWhRugIdtqclsTpCt7sru7EynlsOAIgALOr96hzN6FkoOwhqIfjFXP5ZeKeL22vfx7gHrNrUd8="}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_1.2.0-beta2_1594575546941_0.6232877267135004"},"_hasShrinkwrap":false},"1.2.0-beta3":{"name":"use-sockjs","version":"1.2.0-beta3","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Usage\n\n```shell\nyarn add use-sockjs\n```\n\n```typescript\nimport { useSockJs } from 'use-sockjs'\nimport { Frame, Message } from 'stompjs'\n\nuseSockJs({\n    ready: true,\n    url: `http://localhost:8080/websocket`,\n    header: {},\n    onConnected: client => {\n      client.subscribe('/topic/topic_name', message => {\n        console.log(message)\n      })\n    },\n    onDisconnected: () => {\n      console.log('onDisconnected')\n    },\n    onError: error => {\n      console.log(error)\n    },\n    debug: true\n  })\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@1.2.0-beta3","dist":{"shasum":"0331d4d4449cf14e6f144f934f3edc7c8d121fcc","integrity":"sha512-302CXIygrSM9n0Qk+W0YxIwjvC0SQfHa+zi46SWJNv2U0Sovgd122VSKbFP1JiPe4gXWPrMK8hNy3AtVJXGqaQ==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-1.2.0-beta3.tgz","fileCount":30,"unpackedSize":18988,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfC2NeCRA9TVsSAnZWagAA2McP/jNvjudWMNlkRKnlTjy1\n2aBlprIp/Bx+zTWiqxCTZZEweu9TbXbbQLl/Muf/2wADMLVZeOtmKRfDtuH6\nyX8OmTeR6awfCsKefhaPioDigwxMnRkEobGLOBkjBZ5zbwAOVYsl7hCVv818\n0bm4LxEG53LXIr94O35CVzo71Oaabvtg6lmlVwUYXSkxIFiDnQCD25h4cqEP\n8OFl6C6KBzduw4R8kdSQjw/GXIHMovaljVhJ5NFAf/5aajW6QsMdb0pAT5xQ\noLF/grUaaaDbQk8dmqyJwEz8eay4HPr/gli2pMFXR9YSSKLqryUPc9q3mASw\npp3feSa+pISgbIkR+UL8O2nk4rNpyRCJnEArNxKpekRsviGrv4hrncJmbHZp\nM7Zz5whhw0RhEmWwJz72w5CLAUuXZ6SmK6WJg4q0+rdOoMM4iHnqw6hHpevv\ndW58yiRktcvZCLw56AYEvu+neSOo+8WYKHnCwucIZXpUQfJ5J41G0F63eG6d\nBN4gVdwWjGKL2Sw56dScvOYdtSKdei4OXwBx5zfw+IMtSLr8gFjfRP1C+K9L\nlqdCDydVD541AFloDJNfe0olv+8ZDw3d8idsqXYOYO52v/grEASLJIe5CD0E\nVa3MaDSJiLtpkXOnuKj2vBHIB/oFX9kvtGU1m8SH+JNHNa2s72mQhZ8UBMGi\nOnnJ\r\n=QPdt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWUZd4vEaG2cNT37pNrAbzaGbDxKY/XDfX3IbKftLCDgIhAMnX041oe3UraIQEFPgzDmQvYE5dugzUNF+lPSiCtEp7"}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_1.2.0-beta3_1594581854302_0.6529078448034169"},"_hasShrinkwrap":false},"2.0.0":{"name":"use-sockjs","version":"2.0.0","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.0.0","dist":{"shasum":"eaea6e79dc814d946aecd9a291b7531d4257ddb0","integrity":"sha512-GOiyCF2J948K1QbnNn3/SPmeX+u74LeH5OoqqBDA8+8jbV/usKF6S//atWFRLfGCqjiuxGUxu/yCfwtWAriseA==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.0.0.tgz","fileCount":30,"unpackedSize":19369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDCf4CRA9TVsSAnZWagAAqKsQAJpYANqKlyI/AeLN8mTU\n1TrErEsuYa0fz2BktDFMnDSCesAqJR/naLmNywdXj4iu7fMYl9ALOw4bjhpP\nYnxn3D48ZN+pm0dhO84ZQneWJCjU+r5rqk1GcUxvDujQzkjMzwVQQJX38MbY\nzgkpiT7uCIna+o3VlfYsBlx8jj28ukA9bDpftOtVKau8MGhFyKd9eTWOHgsP\nteD/QHaXi3Jp9XgOgFHmemXQWnrs/yLCPP3CLoOSHMLBAQuynSzj4MZXNcuM\nwcJ/yJXrF3K4KtlNiRqXMKWjdbOnViWzLdwzApIXXNzJ8uoMnhGtPMTSW2vu\nGaQhLAU/0NrwmpjBbcXajWknLjx4ZRj5iIvMsfgcMmKRC7X8WEEzTm6tb3Dq\ngqiBD4upDKffHzUbnyDJubdNjFkVKEbDVggLscKRAKXxM0I8SfpLXDJGO6JZ\niG2Azl/pkfhx0eDE6niqCTVJLMCyrRGSBy297yclyn4q4FUvteMRXztJpDDY\nfz14tLH593u67QXLfR2mtBfpvhpBdj3CQjqimtuLx2lhra9lsbq7t6wFnKvA\ndS/iTnC9oa1kThCdk4sie9OSVJmmp9ZlsnJLpsVI+H1cpMylrG9ghIcb4go/\nDGxM6ZCoAU+8x/OZ8aXpHP9g0Rt8u8q49kL6TZLHZA2hF7Sd70DH1QbdgkF7\ncQ1Q\r\n=kjRp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDh6h2m3EALvq+IDne0eYc9q4l299eHjUFYbmivmzuTcwIhAP+Z/oTAN/OiXOmwN1ABARgLcFOsSjXYNvqaw9qdLmtG"}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.0.0_1594632184563_0.3379758739451153"},"_hasShrinkwrap":false},"2.0.1-beta1":{"name":"use-sockjs","version":"2.0.1-beta1","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        url='http://localhost/ws'\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Frame, Message } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  useEffect(() => {\n    const client = subscribe({\n      destination: 'destination',\n      headers: {},\n      onMessage: message => {\n      },\n      onSubscribed: (_subscription) => {\n      }\n    })\n  }, [])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.0.1-beta1","dist":{"shasum":"732eb4023c51acf6b394b3e2b13acb3c6ce812c8","integrity":"sha512-5itiYGMemGWoaEmTzF5pNXLoyviaNf6s1Y+dNXkHezbMNMsAlfrBg5pDKHFigHgEid4be3tIMl6e5gjlZy2ikg==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.0.1-beta1.tgz","fileCount":30,"unpackedSize":19380,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDDauCRA9TVsSAnZWagAAwcIP/il01OVz8OsdUjMTRhBl\n2bZ4Go37gPDHoLqMeIw5FH1TbQ6IvSH8gGnsdiJaXF6tlGsTeSDdEgHLrWxK\nbKCSfml3XvLTrogD5BL7SuOrBVC1/GWCuByvVD1nByfmbIwDWuUXRXw8hN5p\n1o8phnoDxRmWctmq8hBK2acoU/oLzVv6THP4MdXQPt37Ywl/5U79oyWuDNot\n/XGgFlFIkeCbcWGIyqrrm6rWkh6DrKHh+C4Qf81afq40xNbL+wEo28/ASw1v\n2C4JlQHLv5J8zn6tlVO96h6JX1cx2d74L5HUYjgEarh6g5l6jRgMIvQuM+Fn\no7UMI0t7bBZ8MeMHD0EUYmEP4TpqKHxVMvnzzug5meMtUOK9rF/qDDihdjyd\nh9dAAbZEcRNlLnQ6WtbGrgvxWN0wUNLrUoSeFKI0+VcwITK8HUyJhq0JD7XB\nv7GkPuh+zl7bvk9QO9iEH+h4IpBJ7Ip1Fcb0xje0aGByFdMnQ3GHk4SO0tZN\naeIvrU+kj8+YOJlUgKUwya7I7ZBXY1L77fj0oGe/U2FjU1EcL5LCeOCnf6uv\nuHq9hboe7anYdDXSF2pqilgFgkgZintnuoPLQFkJvBUa7fa4O8oUp8AluCub\nEnLCFsojm+20iWKnCV+Zsy+ZV7E2T08UBwcWA5nlViNCteaSmgkebHjgcLxT\nz2Wa\r\n=woJm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID43YkaSt0N76FRBRQ04f5JOCkOXUpKbaP+5d5zdw17/AiEA9PeDXYSEm0jO/JnLrJIOVELUDZ1i5Y+cxV/F+6rmuCU="}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.0.1-beta1_1594635949696_0.18167918366829228"},"_hasShrinkwrap":false},"2.1.0":{"name":"use-sockjs","version":"2.1.0","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.1.0","dist":{"shasum":"458ff6aec1d68a05620f14c268ad976b5d8c8c5e","integrity":"sha512-ujQC7Ufe2wDqqVWNdDIq6oV/aS5Ioir0hClY0KSP/ftHzMzhlTeQ3g7cRSWcGwkvcUidxCbKfjtos3pBr5U9eg==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.1.0.tgz","fileCount":30,"unpackedSize":19359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDJHVCRA9TVsSAnZWagAAqrkP/2LW7sDw5ATfQYMW+vfg\nvxCFr0aGNm0Cl9A6+ny4z6INuk4O4AKGhoVoq6/IKCLykzbHdJl9hz5SkwXN\nW8vDrxVHPt8Nez7T1rupiiU69WSUnyGHGFcuESwtrhuRxD27QHLatNGelqnG\nx67VSGNmks7njopcMOVa1MgfjzE3LjvupQRCICWbzjSYUUx/Oz9KFoJKivG4\ndB7fJnB9JSMaXuckb27zl5AFaryQoPDS30QA9mVSXT6OeyZczlNKngPt9YXN\nNajytLQetBfu+mwjDfsLFby6SZP8CsYXXnCk6UWZn+X/X9dx+EE7WveDbx6U\nP9jPzQSRyO9iZ9Q15LsOaOxyIl78uMv1G/9+uwtfTD8PryY1fNByj1yEAITh\nv22h71ArqdN8Y18mEfn2u6qhFucyD2UH2P40ZOpmlhCnPh1/aLc0r39pq0KW\nViek82OsN/VmJWS7c9dMKgB7H6jyO+xx7gnkEgCLtgaHJn9tOt0OOtGj1bFw\nJTSy16No/xUemq6O58mTA2blb/OY2Npasuqg8FQ7wj3/GTmOD3TCcTb0XCq2\n5AqF9FLlTOZs2sDJbSGgv0FcQRnChooRben5WCqk3QZzBqJjKRpmEiNXtGz4\nNtpo46MFBJPR+kxYkhUUXWdUw2LMQus4wDcIRQ3iQ+hJLPlob2YNnyEikAVi\nFQq8\r\n=rAZe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBK3lK38qURuFgMX4+vI28SXQlfA2p2QhrXgJHTSupr3AiBXKfa4EX9HUwGZBGfsSx8dKgJObh7bjYd3q88Z1bMqXw=="}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.1.0_1594659285525_0.20653276807970444"},"_hasShrinkwrap":false},"2.2.0":{"name":"use-sockjs","version":"2.2.0","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.2.0","dist":{"shasum":"2c86128d5a9a780612821f7c679447c878b58cb3","integrity":"sha512-gDlfc3lUwO1Zz6lOFUmHZF/sng6qQqYWg4oAauGuFoFTq4BmscxJ+UkPYks8Q+EjDnE62jZD//V69XWE4afxTA==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.2.0.tgz","fileCount":30,"unpackedSize":20494,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDnbzCRA9TVsSAnZWagAAQzwP/1h6AKiDiZ93u2TFYFew\nHPrCC4EDVsvt69SggnXqgE7brdRVdnrHmvsAKe3ySrOExqLIFeYaPbkRHdhB\nSfxpWWpO6ZtHKRVSVAsmJWy4G2tgmxnR1NT6lOpM30TLSRwLsOBG3qQ96bPE\n3Y1Mht6NBSuGOboq/PkrcplfU1+goxgAgJK5uu2q7JSt5U34YUkX34+X8Uty\nKYcAxjB7cWfP1HF0rHyetIm8mgf9ZuNhi3cG2kIs7rL1UCzItI2bX+qZK4ME\ntXa5nEieB9SDPXH2FruhWDZtmm0LnryDBDEFIWe5NsKa08qXi+UMeuC/5HKI\n4MRJ4NBqhAguEyMFAwl340epUm8gZf2bzyJw6uRWWXt5d7kU0NJ79uar5pz0\nArklkBMPVH4OeC1QC7/0ow48QoUUi5hv1Ow2NLH7TJS0eCYvCWJpiw6IE0aL\nZzgNBASm/L085lFxM8ZLLNqNHWbFNdKmwxreZBBNhN8Pz0Po874e6SN6IIQr\nVLwgxQxU7pp3yszP3k+/493XGJqArNP7hLmFo93+ozY/ZBludtqSIuXMngbO\ngNPD+PUqTUEYgJTLkQPbXnvZTStqU+fDtUP6dZQ5WQKYIIj+VBzQTsCOWI8W\nGJyLYvSnev2qKZerwxonO1WSy6Snd3RcJaj3qd92AER17fWCK0shxsSB+8VQ\n+3xt\r\n=UkUV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZsIdrCq4gQJ9ATcJRfu869faR4E4FVqGyx0GNcA0WMgIgb+Ke5jyafZKFiNh0THokO5PUB17UOyAUoZ1JmlAoDoc="}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.2.0_1594783474836_0.7249715931976102"},"_hasShrinkwrap":false},"2.2.1":{"name":"use-sockjs","version":"2.2.1","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.2.1","dist":{"shasum":"022904bcc32a6f5802d3cb032db13709be0ffc97","integrity":"sha512-1G5Ib+fjUHONoDKffjsLxgH3VaOrCnzTFSyWeW+hZlFJ3qysYY1B7fSZ56zcoSoGKyHEXehWZ4QTSBADIDFF2w==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.2.1.tgz","fileCount":30,"unpackedSize":20237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfDn4BCRA9TVsSAnZWagAAgBIP/1W9Y/K1H4MugjmK8TOh\ns5ubxjnX32UpiIQ6NrhpLuYSaNi6J60v4LDszLyxt4WkKt2EHlvv0HRZ51qb\njVn1OOxNFjlPnZXmAM128+P642VzDhGAnMxBEY1mV4HzLQ7PHB0PGRaK+AL+\ncQvaLDt/0Q9JK02B5/gIDsXj/KDG8Exfu5DhR0yARewgaIS9V2L3V0mY0G/I\ndjMLmbluL/63c1GpRmNp0QGBaK1HTqNENNhENF3GH4yOkwfQl6nClCL14xpw\nU6Iy+IN1zbCcKb2KC9L9hiX+w3EMke0tbW5TYfmt0flKjgT+w50xiYWBlVgM\nEkJDGjIY4dL17VnqLu57rp22K0JlUWQJIaL4NwZQscRGzmHTghfUiRpD6ioQ\ncDeLD+qMEKVJEVR5TYDAb58IwyMeixzzsuie9gBUl1amhIUem72Vy2i5aPwk\nC6tc+TTZrXqqZIiMlxbfYrJogzX9o8tFwF97IBjgeo+rX1g9j8vMo0wcYjbD\nd/tdeAB/q2fV1AbPxNq0phh0rAXGqk+WqfW+pDyemZqbrpS4Hy9/qHwPuwEk\nt3+FBpPNgV2yIKiHmSybPrDVimUyj71pIBTp0JskiPucmoJ/ap6crkwVHdsQ\nrMdK8NOGpp7sOpsDBa7HWh11il6WvpZRu6heM946Mlu6gyeutVjIQAliFdqA\n5ZfB\r\n=PEpK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCXmX0juw/m485yHORwUj80PgxcFQLl2shXD04UGpbe9gIhALqPUBgQIaTDAMxuzBNivkvKNQAgUwIBGKJpLf1M7YcG"}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.2.1_1594785280844_0.0025384517083579805"},"_hasShrinkwrap":false},"2.3.0-beta1":{"name":"use-sockjs","version":"2.3.0-beta1","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        url='http://localhost/ws'\n        onError={(error: Frame | string) => {\n        }}\n        debug: false\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { subscribe, unsubscribe } = useSockJs()\n\n  const clientRef = useRef<Client | null>(null)\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  useEffect(() => {\n    clientRef.current = subscribe({\n      destination: 'destination',\n      headers: {},\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      },\n      onError: (error) => {\n      }\n    })\n\n    return ()=>{\n        unsubscribe(subscriptionRef.current)\n    }\n  }, [])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.3.0-beta1","dist":{"shasum":"78bb4bf5d740fd2f85a03e3e52ef31aa6e9bc13a","integrity":"sha512-rKj0ZgyAEWSeMXcC86GvQH+m22ju+fWn/x6exyw+1TnSWxRMi+jF2f/4ZsQbUpGMo+WgAwrh7WNOjspANA9J4Q==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.3.0-beta1.tgz","fileCount":30,"unpackedSize":20898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHnyOCRA9TVsSAnZWagAAz3YP/iylRVIxX5mYdJibN+Vg\nGZQvzVjDag8E5uSupTi+5CTjWRZ7lZtRFEpXYFePx7odorgSis3LcNcvT2jW\nEpefGyvHm54CM/CcGOOoZrbF31TeNXI/fMJwWlarUY1nqFuOd7uK6NfvnMai\nFskxwIOvgVKVwJjxnSdOBqVABPVHMSIoNapBnARYhu55A0wF9CHv8EupXQbW\nrxpp6lzyooLUOAgpFMKszAWG2i2L0ObcGOcjMKT9WMbwqVYjj/OZT15VYiQW\nEVn21p5C+puJ+0ixeJX5K4pJmaxrLIeaJ4lorMfOnQG+B7hs+2YUF0/EvWSq\no5bNHAW05/3V9UmdczHHRcqsvgRgAyBQeOXK3gaEBLL4lRWQbIS4z3KvUscF\n/cQ5ALlgHziHAimKi/a7Y3dfec3QJf3ML2UOk4eo6DZcWXL4Fa4uW11v43co\n/E4aVgxiZpebid9nIC+G5l2p6lxqY281qcXIGJhDEgpggrF5PptBJFxC2zHP\n63je8Di5JWHTCKbc7NtmfxREEobSk+o/ChSl6kJGXWGpoZ2MWed22F+E2G5p\n5u/+hc9W4b3nxpBVxlW0fE6fHDwCRfMlq1prOOVMZH7OE+vUJ9EVsdi0cGfb\ndXYMuaH7J0l/yZ9A9UGuc3HDQDZKD81TaA2CHmYSTbdytpKXKaY+qU56gztS\nMtiG\r\n=xjb5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHC127Ql97j96hdZUS20vQ3fYVjnUqGNPYIEIhLeTXiDAiASUI7Qssr3vk+hILtu4g65I/8XdL6wN8CbALltY/AsOg=="}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.3.0-beta1_1595833486032_0.51941819127276"},"_hasShrinkwrap":false},"2.3.0-beta2":{"name":"use-sockjs","version":"2.3.0-beta2","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        url='http://localhost/ws'\n        onError={(error: Frame | string) => {\n        }}\n        debug: false\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { subscribe, unsubscribe } = useSockJs()\n\n  const clientRef = useRef<Client | null>(null)\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  useEffect(() => {\n    clientRef.current = subscribe({\n      destination: 'destination',\n      headers: {},\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      },\n      onError: (error) => {\n      }\n    })\n\n    return ()=>{\n        unsubscribe(subscriptionRef.current)\n    }\n  }, [])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.3.0-beta2","dist":{"shasum":"1b75629667f36adabcb1dd784b946c2b53487e18","integrity":"sha512-e/YFK2D6ePRMtHTjfNgzvzFCgrFQGxcEb6a6GT3HZVdtvMXEY/qgXF+SdXWxNbMGRm7HX99mC4k7a616umqt0g==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.3.0-beta2.tgz","fileCount":30,"unpackedSize":20806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHooSCRA9TVsSAnZWagAACtYQAJ2YzpyoBaJ7Ka+ZAC5e\noQUskze+KeXQPAV6rr0NjO1Ni3i7lbrGjMNKHv5dyYJffXwgk4HajljvvieK\naHUYVhWTJ7eBzUV0MKZSmeaJQhQXOEKNQJlqutgCiVTdZXxzJ2Am//VKB36T\n2hiG1PoIWn4a/PP8BF7QcrrP1XToj40+jZQ73CRvAYIYKyaX4A6Lqa9ut92P\nJ2skPJfLbRyK2sDFT4ylcJtwC6irHiM919LkCFefJl/k9Z16/wZ+xDAfCH0s\nKj3s63DUASTsWMH16Kpll245BRUpXH0Ocg7IlQE0CMeeyHWDadLClwowBPyS\n2ARRkGnoUcXUcq1j+vOskce+yaxMWDDywjqrLeOee5iF1s6hHrbVDu3W9HNl\nycy0kdImoWbbteMP9RtSkZZQnhPSDuAQNoKGGwBaayLx2uBO6PHlPd+xVfEG\nFgeDNvC1Q9cx0KQrsNc5gFPNt67S+WOw83gDrKAiM0cTCUXWKv3dCUyN3ims\n7TA45JPERZ+HagzXIsreHnd5u6L8za+uslblxCjbLBZ4/+1dmNmJKepwtlfY\nvMXmcarF8za4nG+vtJLLiSs9S8HXkO4pkWF+m5b31B0bgjX6vjbvynqCMPH/\nvkrUEljpjqVzSunuTeX+Yx/64nJkj43bOALC/wJ8ug3bWkAjMZ9Hp1BmTHJ9\nsBdC\r\n=6xKm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmAIcjZA3fetdR+2yRhpklZjnEQkXUBz7lSRNwt6PJAAIgM+dXna8ZJpzpsvr3K+kBu4TubT9tnXJJAy3DNY4+mps="}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.3.0-beta2_1595836946034_0.9116253389467806"},"_hasShrinkwrap":false},"2.3.0":{"name":"use-sockjs","version":"2.3.0","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.3.0","dist":{"shasum":"6167094fd30804c58b3e628eba0507b96a6948fa","integrity":"sha512-g+lc6tFTUwqKLuAM/+iCUzrqnPKLnJaWuBwsQqYRyMbO2m8qALPU1gSEVSNmWSu2m483/0PHsvyWH0ry3sZQhw==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.3.0.tgz","fileCount":30,"unpackedSize":20800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHoxjCRA9TVsSAnZWagAANtgP/0WR1FvLOeyMA/ukPz+T\n13WdDa0FmD263ZS0FcyXaeIUEIWqE9Sl1pSUjvO736GN7VR4p9ZfODJ/8SxW\nSZdjZWZvF/VMZMiI97V5oYoJCnuf5wbNEYmihmoxciLIUG7roeHmctGhYM+M\nkYxyWTEWrfiZ0hx/JrCaDMrknSjbnetiXP3uddmCqea/eni6E0MNce5XAxCu\njPvVMuFSmPMSagKgYyt+nU6uANQ7SxZ1h34XzROnug680RWuiD5RCXPz6eKA\nrdZlzTSQhXWUr1RIXGpMZD/Y+G7eBMrUAlHqmptCszwnnGYMXZ5AS+nL2z/2\ngbANeNz5kOgBePMweifDLpb8OtepR+t+Gy6g7i4eRKNVym+2Gtib4b26yu2H\n9etwx42cuDI4JbdWqQUkPnSHxHDSbFtyqwZ/ph+Nfrsj9+tTwG8jNFtJjc77\nMBH1Q99ZjNyOa+Q7BrTvdsaADFH8gsm1L3bNZHEEDdjHZd/Ed8HwtLrw6mcx\nwRt1QzObOWOqXvkGuUw+WDH7tL9SVgP4N4hYr8QYm8tLlsGEGyZpUT+KTAsi\nrA79aJSJjZxXylugzo07FyRURd3ejTvh7r5gUAamMZBaYhAY68zpoVGBehuj\nzpwDxs3YwfRgHzQ0fwdwVlytQ56WDaYnKXrkMdT0I9Yu8OqToD7rCdG3R7KC\nUdAw\r\n=fjsi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHxzqTWOMXtFip4qfGGf9TReI5LcZ7tRXvhe5f+qXGoqAiEAmFmHg4xspyIzLqNTAnYP2RLLmU4Paub9m/zCyR2pzNk="}]},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.3.0_1595837539538_0.9455816660363237"},"_hasShrinkwrap":false},"2.4.0-beta1":{"name":"use-sockjs","version":"2.4.0-beta1","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta1","dist":{"shasum":"8304c17c169d5c80d3d5a2b90418618f13a2741d","integrity":"sha512-r+k9gC07+/cAWjfqbfl8t0xExjldoEj20x6Kqe3fhPm0iUUx3Ry9Z7fWr5YMIJAMQ0GmAHYyRs47hgKduqvn4Q==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta1.tgz","fileCount":30,"unpackedSize":21991,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/nZSCRA9TVsSAnZWagAA5mwP/0xQ0+HuNrrzzvCQI4tm\niNy/VkEFMX5VsllfhUCDbMb3pXv//zySRQ/qA+amPMhIz/3HXezhqDSQ8DqW\nIj13HsHHa48O9so4n/d5RJjwjbL9fzVHGV3CLt1tuj6qnNNA8lt705fAnJP+\npDC68flZ264KtQI+1otMGYocUROGPrNI/UT6zNavyX4xdWLlADxbqbx/9qOq\nQZcLu7wJbibngkWMKgf+PUBb3/EHD1twnDgV+aOH8M8V3rQJLzL4pViHBgJt\nd6obOGPQbaxMwqyXwafDdhUIWvcGpO6Z7iOjJVeXz34CuiYS2MkyJ85Wz0mf\nRuXlphAiWkV2/UFsFTb2wOc9XTFi6RzsurTyCNb6yAVl3alc/LhVFiKUbaqd\ngA4z79qR8afHUKBe+ANnxBRJSrcDO5xHl0cXYjXGI9xBplfG+Acpr1CDz98T\n0z0B0omIM0J0EAU7tGzz6TivBMOnvoLH9XMiy9DGIid0bVCR11+r/h6xFA6d\nG7E+1MtjSh/x4Oxnf06kL9QRhQNfNGZsXZDsA3VRRAsN6D5KsgkjsWkBZtJV\n5ddah6YPt+2Da54NziQkwRoAYjZzT7icwd1CQGVzxIEWK3YIPA4fN9WJpzwU\nX/AJP4tgoy08gMQzTMTDWtRKU9RptXkkTOZbs8hR89861j6lZq5spOBGZmDr\nylfw\r\n=0KoM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBVwTF0KGTW/fctbpkojxZtvwANGp2EIAM+cO0v00dqUAiEAyQNubmwhQGUsRRxWaycm0p3A7siULa/+pgx0hw9dR6Y="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta1_1627289170789_0.46551780167448764"},"_hasShrinkwrap":false},"2.4.0-beta2":{"name":"use-sockjs","version":"2.4.0-beta2","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"16.12.0","react-dom":"16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3","tslib":"^1.11.1"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta2","dist":{"shasum":"ee632d9a06d493646dab225530271d19be26fb06","integrity":"sha512-CSSB1LFT6GhRtgvLtHfzCGbdXCn6UmD1qLmOOADFLEhRGB+AZOM8ApybC94YXg3RTmlb2atp6KsqgU9qaJZ6ew==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta2.tgz","fileCount":30,"unpackedSize":22355,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg/nqJCRA9TVsSAnZWagAA9tgP/iauhJ7aWbbg2KBYLqYo\nB7yO2J+ZVkS1ojAuKAZOU49b5dz49KDWKQE/pKcubndYwHhtDmTVeTHlICeW\nbiLc8XRzuUaGmgmc6XH3FYNuQJ5oU+VTKWDlpQQ+NufQKwsGaOp0PsllsABF\n0oMTnH1VxkLz/ShkZj+EdTcDz2FX5HvECVvvwTOxowNSo7DwiyAPuNPM2jm3\nIYzP4gat821B4FSMwSuuP4F6UBRsWPqYalq53DxRJvOC9Yl5TwhsUDsXuHqN\nE0gOnttRj704HIP5A8ExTCRIKLQBeJzl1M24n9CYl65eam/XCgzmEk3fPU+w\nqHKkAC2AWrzx0vAJ/ENmp6PPHfjSttqNqwctWZx/eIHC7/U2blP9RmHLWRiK\n7WGKcTP8pKlvs6KxLWCJnTwHWbFOuxYIHcHSLG7C5nCBjyJKpS0KJxa65fcB\nJ2qJULFzDgx7J7qboSr1bFh70aDBy8TTeh/uRxWJ4F8LQz8ahG0hV93Kjj4b\ncdY6TZUGs1i5Sy2fXEdrpFVvto/5uAMOPopuSUweGHOGFYRlG/JdLECQLYws\nQiMnbCXsDeZnZQImJ53twTD47XsFXEC61RcIrDGjuP+QxLCimwA7t/o/SmAJ\nWeKMu+k6frxEyT2ytVr4olMtf86DxPFEi9sIdp1JdFS3lX3pTcPc6M8yu2vb\nTO2U\r\n=p07M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFpKAp/08kn/w0B3EmAEWxEV1i/7g9F++dcm3HhTusaAIhAMWd2FvYKq2cMVh3h9gJypRBSy5y7eBwe8iyWgK63icx"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta2_1627290249354_0.16562608917087474"},"_hasShrinkwrap":false},"2.4.0-beta3":{"name":"use-sockjs","version":"2.4.0-beta3","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"tslib":"^1.11.1","@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta3","dist":{"shasum":"c224a9b09809133bf79c32e69d8111b0f73e2711","integrity":"sha512-2mayxPyV3W1V24PPAPHD4624lHlwc+qHCEakDpS8f3a0CvZuSUjeVpW4jXC8g+OJ1YSRE/P0KrjgaQdi8vdNLg==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta3.tgz","fileCount":30,"unpackedSize":23446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhASHJCRA9TVsSAnZWagAAXNoP/1T1iJnaoVHitKJ68WTQ\ntIB/Ds1wp+ahRiIAf5TyjmBA0UkSLWqmM3SruE0wed+AYJISKuSk0wsV2+NK\nFO89I1PrTOew9IhpUwtxYEoFl2sD3/IAchWGmgjE74YyUOcn+4U9xcyzW9D1\nOFXbBawm45vYUo23lJVrsTLtkrmoUSG+X2qfD1sQj56G58JBOlWBD0mfVrAN\nGmYGq7Qv/yKOOHTK+msNhs8yYwsyRWw/ckgjviEdRAk+GWbeyuzRDjBECTKs\n60yigmJnmnGL+NpYvlYinbo6WxoopEZp0/AXrKXgi/7hxj2pbnXvKtvSIUwc\nB6uMnKf1tNKj85Euo1IROeWNnDDDuLXnax//RvkG0ZzormUnD7DRCLExnvo9\nrWKS9o+uINrZxXkPttra7vxoEZW5f3Q9UmGRwDSIo8udXJRlVduvKTnNsyYa\njCmdcsp2yaw7KuJYiHp1fBh6AfdGSiZPwRwD61RRKF0ZZXNtMTCrsOp/xiuW\n7LImgrlWvM7dCqFqEIsyncLJcodQyapYJKgfLLNvWLHrKn/a7s5OJ9voBJA2\nHDvKKb6isJznfiC2aj1vh66FwDSrKktqAp8Yd9nwoNB1onrqaqP74vFM+gSt\nL/3+depH52/A6sq3E1pW2XWlp768gUKjo0seRMdKoeXj3kox0XtMAKUKHdn0\nbhVi\r\n=HvFw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICC+CC2nKV3pJLWatmI21kF3z3CBg7JLli/4InJcI9HcAiEAmMUUhwQt4CF0Y+nlbg3dDfa4VM7gyQ62WxpNdyjMdEQ="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta3_1627464137011_0.4900358649566432"},"_hasShrinkwrap":false},"2.4.0-beta4":{"name":"use-sockjs","version":"2.4.0-beta4","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta4","dist":{"shasum":"66888c4f48dfcdbf0f0514d52a44b5027027d948","integrity":"sha512-Rf4gtuWwL7oJBj0Zb6DSVAG/UGyag9Q8grVJD2HVFEA65SfWwzMEcMJttaZGu6g8GyJ9iKWS1EK/lbfjYIspzQ==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta4.tgz","fileCount":30,"unpackedSize":22087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhASLrCRA9TVsSAnZWagAAuNYP/3YTLG9m21FUS44X+B+J\niXK8646NzHJroTCFoDUcn0hmYdX6h07oPRhQok9RSAuGrh9YVMQHAffYLZ5u\n1yhAM2rkLlWNyaY6XGUDKgzhptWO2W8xVCA56eOYcPBE1191hROv/eGCnkEO\nlgUAn9wDZyY5wrNy6MsoKsX3QO9PVbSknHAu4gjRigN2WQA7Vp2xzUJqEqEB\nS/0OS7HL/U43pYy7xPdBTN0NDeGNgYh0ygGk+UcDQYsvjROKXtO0ujxmEjDr\n+R3F145Mb0Ss4p1pEqwGO5i28dGm+OQfDfxnsbmrZaQvyaSMCPjQknymr36E\nBNhLLWz2WCgScQGhXQSXYOk5m6E9ixt3P3gIu/7CERmmo+DlugsqVcykB1IE\n9+Ook++kJoQP2ATeENWe21nRe4xtXtzCCBjsuwnKowkd0R6Ies95mumhfAcG\nptPcxih1rg/tgyht1RQd9z6xV80V+spWOWaRk7WPUkwnbakL3PZPBR7YiShl\nhUH6KTNHufe5WCfnRCGpYdjBC8RJ0Tv9z/dfOcVHLKRxnAzflQ6CJh8VQ77j\nWYZPM1O1DBIxi7QmEGLh1kEyngQGLyiB3m7b2Bf1FOxtKhLqiLM8fxjq6vV6\nk0dUOpuPuGiax0a6jc15TZfP5KMI6bw7O3qgtOBzwAjq1ABXpa9zHoTUJOOE\nctAm\r\n=Wy64\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnlVXdaxumOmVtjcNoYvPrx+I52QMzOtKdCH36NNvjAgIhALx5MHKjI3eDigB4k7RO04PLmgoTfTM16CnP0B+KRWRy"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta4_1627464427711_0.3394725670044001"},"_hasShrinkwrap":false},"2.4.0-beta5":{"name":"use-sockjs","version":"2.4.0-beta5","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta5","dist":{"shasum":"d0b200c851ecfe8af3215c7eaa6c217f1770c474","integrity":"sha512-cZOZW8FQlcg+wAhVQvdXF37TFZvnd4fY6eeDyhhWpgYBSU+GFxFqZ7erZFlagRufXMiMR48nJpdqxeITcpZAqA==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta5.tgz","fileCount":30,"unpackedSize":21692,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhASTeCRA9TVsSAnZWagAAtXsP/1gzCIweni6zLCPxIFwA\naMhZKU4ovBVf+mVPAMC7CzlGXFJYUCUPOHBd4U/TH/hQgGz8/wnI1tKker16\n04ErufaBwvoi8mu0sgH0et53qj8cTX21Lu7sk5GnMrA2E86yTyGsLJ6u3DfX\nTPrhJmmqmF+WSkjUA7IYYiQtnbc/maaPSgjDRO+2N7++eue6C4D0JRGombiH\nYJOFVt+B5IybLtGRgrJJIQVO89F57FYwR+TTcwizB03Wis9dC311PRC3JY9A\n2XthZAc6JOHBQkkeByk3VyfIgncvaV0eOJvnkvLxvn3sDirhdgS3AWRGUVep\nLDk11k8KiwHjtRiKXYxFrrQiEV7BGTdnuK/hA1qHOJKGcZ9fjPwEmwYkFN3i\n29LQ55cqyHpgM8dfUaQ9fMyZbdxXI3vinf5LdSrYw35h8UHuwFwUQe0I7Ekf\n2amJmpZyHZ/QmFwMvYaw/bsCLA553pFHhFLlCzcgrluu6SIbolCDmgjYbFP/\nGWWi3lc2gLfgr9HDTC9Atbp5jv/q2ua5ELOeUhp5CGWX4ViTqwX2JwYIT8BV\nbv7hM1fCYqn+BobvyPU3ofggn37wIewmpxMo78QCL6fsZdDZZScdPp0j0ztF\nsj9eZJP4EtWSwuVfnrlvy29GQHsL0oNK3AcmGWYmbQNPdSo7aFTeqJ8LJ1MM\nkpzc\r\n=EGd3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBDB8+xvVGJTp+ET54t7PPoRgYdEBOWZtaDdhuCOYXKNAiEAiCyd6orUq/kVMuCvL952X0AGxA5eVTH3HNNYvC5XeVM="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta5_1627464926742_0.23774122184275437"},"_hasShrinkwrap":false},"2.4.0-beta6":{"name":"use-sockjs","version":"2.4.0-beta6","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta6","dist":{"shasum":"e3f4d40a3b958057955a9b037f73575abade7e40","integrity":"sha512-VcBNRCjX3nTwkrduZxXVrhNeUL3wzWIgcVoqOK7WyPXPt4cLfBfL6EKBTAJG3GORmQcCnyCYOYXFxwQJpHeT8w==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta6.tgz","fileCount":30,"unpackedSize":22070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhASh8CRA9TVsSAnZWagAAduEQAJ3r97oa6WscXANjjv58\nDdNf8L/6S9Dol9MBTz7IgcmHb4Wrg2X2r4t0FWCodB62v5ethSatAsJVLzo7\nsAdDy2hjtHq0zAXSW6RFcwiyeSzVVDDzo87e3IdjXA9Vm8d6BO+lXH0Sii8S\nqbKwy39D3XdeVJXA/cQxWrAdl4OXP3+E+nSYXTC7EwjFX72C3vQYBi9KKvzp\nX8Qx7/rqgl3j//xU6vt7Our4UnE9nbZMZ7fI4LYUPFCM041fQCTQKxMAepAz\nWwgl9lzFky+LjLTFEz2nmbiEKleSd4DRZSSsunC6fYDusjlEw2uJO5upaF04\ntc9/yWa4Gu0o8HYyaoHnzmvu70xZazW4KFidrpPVgl+Sfp/4GNCd+8ni+A7B\nFC3IgWZ9Ui8PsedCqW0Fp12tmcJV+jbm/rCA5HnFChyHWKgHN1GlEcLUZ/9s\nHCRQ4fCucGriOox653mqxJkvCvcWTtg/Wq5rYAecR6+CELBaeGCX40rxKpCZ\nh/RQGDgl80MGIMGkPJOvmECDWaJSGxvVJocm4k0v/uOZnzD8uUFNMYx6bGF+\nz1LVqD0CgXSq+zOOg4RcuAVw7nVjnu9hEDDg5PBwrwisIEn6AOL9us1myhFT\nhaHGiAOMkVnpmXthnf83GEU+tMF0ROk5Ya/PaQ1czsbv5Ac8LFG0pciHa+oH\ne06z\r\n=MfWD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5lSQUxUCdxx27YF7XmfiSq0pe723H4uhi4e7KdUo8XgIgZiqsd8H1C1msG6azrk1ejv4evBvbwtf2JXtVg48O5vI="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta6_1627465852091_0.8400149109863666"},"_hasShrinkwrap":false},"2.4.0-beta7":{"name":"use-sockjs","version":"2.4.0-beta7","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta7","dist":{"shasum":"dcae07ec732b51c87a82e88d9179a3581a1c15ec","integrity":"sha512-VVKKyCKQRWMwtoy3rwY7BYmeD3f3uCLaMp+DIQ9zbChu5v+r/vucsDX06R+DzplrpAJCF5bYrngLWz9lDYiYng==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta7.tgz","fileCount":30,"unpackedSize":22348,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhASn9CRA9TVsSAnZWagAATbEQAJweczegr2cQH23veOIj\nKQ8R6V6z9xopo5rHssL3cIL/Jb1FpnLNeKGun8XXyeoIpBj/1o7UFM7euGro\nNsDmjdW6bxfG3i4M8iK5dOwLSB+Za9TTkKsGyam40GsAGhlyfeNInmfHKwuc\nODAKzDEM5DXEZHY01vn+1Be/4kFsH7ICYWV9o0GKsCitrDFFJSNos7XnWVDc\n5wqeZ2vWPUGbT7HbRG1Hz+Bj2EH8Tn1Ysn/77dVhdb/dRi40gXcjTlMMiZ/L\nvzS8NdFWvTDLL2BrUYmc/B5mTzkdJoQNRpyTxOmRfCs8a6vEP2YQTokNiuoA\n/XeYxIL63LEcZKlG4H/U+3QnJTLfG8/T3QqyVZuHnBqz91uVtN2F4ZoiZDzE\nclrqbKnoBFeCHoS2SEX+Tk99+3IMrQ6E6DSrHEzXl2qH7zcLAFlRvMwm1AwC\nmWtedJ+GzwzWfbuNLExRjj83GozYLHbp5NaNibuXG7w4Ww3UzKLNPBcLS4aU\n6oBTxZzf3paAitmzX+GBx5aFTc2Y4nwri4/Uy/ffV+vy4hsjwSlNPh6A6ml6\n7A7vWrPZU6MpIRZewgA+VcdO3nKNz0cNzajimIIlBNK5f7GZ8Je7+a0qnSOk\nXsrfmvYc7q6/Bw3pyg4hsZXIkU+9WMGzCOFKBj5dFXxnXvZvN6ZEzv7Q4BYG\nz6jN\r\n=4xFZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIARXWdMdoCPg+jpvXP5mIVE4i5F6Km/oyA3YfUi3cvnAAiEAgJUHRNv9URbOszTdQKpNoxVrpOD+lIiDBQcJSxuIVHo="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta7_1627466237323_0.03467427100124909"},"_hasShrinkwrap":false},"2.4.0-beta8":{"name":"use-sockjs","version":"2.4.0-beta8","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta8","dist":{"shasum":"f8fdff1b7a515048167a7df16d924ec8e8f6b291","integrity":"sha512-emkey+ggZOTjYuZ9iFn8wOrisMJWuz9vDXfdqF0ChJ6cRnGS1WqAEf5LzS3FhuhNT0Ok0piYNnvn2IRVaNsskA==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta8.tgz","fileCount":30,"unpackedSize":22205,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAiSeCRA9TVsSAnZWagAAdp8P/3UexnDWG2cn1njipNcT\nqZjksLhyp7TjUx2/5+jhoZtSTUqbd3xBB4fTKYsSOfkUli7E1nReNOJLg9/E\nhQq7BzDej1kHoz3CM62WeWixvFmslbrxfeLEFefs8BGpXN1e9cSWhfZdNZAe\nCL5mijyE2SvtnpFut3voAwBOqrkK93/Ggo3fDsIbl/zevKPsnseutsiLCbVy\ndhKTz7XaMLSxhJaLvcSIUwtD3a6uznS4vdTnvJdU6k6JnW9orS2pGke5pyzA\nY5AqRIyuZXVfxEgeNqK8MJQGoGUgptL2vjdIAtZKfE5lbOYTInTvvWzgh+Lm\nZvBm+Qa0CdoM4VWtljFjJP2XJdj3CBbosxsq5eRO1932ujN2N0el1hCsaft7\nGp3133AduzW0cTaS1byFdE93kqQGOaJW+gB8tuQ5Ve/FkUnStLccOyc8Wmt8\nKtwi8Mhsv2VJqdWsIq8BYbbMo7xM+8V8kFIQ9i66ZpVEta8M/GO+p0rGcAcU\nFt8riA3Uro797khKGF1kJ+xfdAbdHTbfp5EqRwaH6m92V2wO/8D7gnYq9wKv\nez+CoHvSS/3HA80IY/I3Hb1IEE+255Wgu5TjK9pMwruPuxmyilK+WJL77Nu2\nEv/XdJYUE1M0grAZYupT7L6vUb8Iq25Fo8Vfwj1pmlUYPp2krytz+o7gLjdj\n+huZ\r\n=dBei\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZrv3B3PHCafJpiy7TOv48NJyHn7gOsHBBzKhFOuHM1wIgFYWPRPBnDX2eu3ti+5tntBCxRllY0krkswJ+V1Cr0HM="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta8_1627530398056_0.7596483429353087"},"_hasShrinkwrap":false},"2.4.0-beta9":{"name":"use-sockjs","version":"2.4.0-beta9","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta9","dist":{"shasum":"378891cdaf9d62654445a950c64aef4ed0d8f59d","integrity":"sha512-QDeOwYFAbVj7tLyB37q4xwsV8w3QLgiyVIcKQiWNrj2SM583s0+3Oqh1KyRJ4LA65GpExE1bFlf1sSPSvkRZIg==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta9.tgz","fileCount":30,"unpackedSize":21509,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAkZMCRA9TVsSAnZWagAAtTYP/jsf8g1aWbQsqfb2PABr\noLS3VMG93T8V8LbiZwInjGRkc1C1DjsG0/jxWQT70qmS/WKd0de6EjvNSUpL\n5nWz98NtISBvC9Sdk4KgSZ+xiQUdHPIqvtDLnMxjq4iQSNu+njzQECosRHlw\nV5RMjp9Wdi009WVFc2dUqJvEWYshfAOGvwJehZALNXW+KkUDr/301VWztp8U\nQ7iOcgUi3keSNnfPIRvlw7308/rA9j9CFaG+9VM5oUU9vMvcnN/kxg3WDBJy\narr0Nr90tAyerESjcMJ1lSeCGjlUhkEBT3ulBwixDrB2DK1dx1v17FDD7QVE\nAb/05Upc1tJEwmV+Id5tS09J02T/Edc42UKPfGNvFyyUxTQZw13K6OUv6aLu\nCIHloGH00xiDgzbA+q77CPrbG7g0JG0K0pXnsAt5b9mueYwmRzsjrc+CfVGO\nk8Rpf6HGX0jyDZIAg00Ffuy+WvYruQNuz8bP41VuIr276snUXh8XQb4kQgaM\nmQbCg+Swi+l7CeEDDYdo4B6U69iHThobcue2aDGS+vArEqbOJv7Y+RymQ617\nCerq0HJcgUkJ6xJPxPSgEebdUGczvESuXlS29/GUUBnmzDmlgc2OzbEBy8CR\nunMdMdhv/m0lAAeEId7bPYD/KSvl4Ck3LeJiySS0KkMknAPjCoPXHzQqZ0+u\nk763\r\n=R807\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZ2SUil6g9ApZe3jgo+IlaoFZcVhrDd/ehJIebhsBcIQIgXZGk+Ddk3+h0/vxJTvI94n1rNCwk+givhPZT13nLriY="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta9_1627539020671_0.774919015512745"},"_hasShrinkwrap":false},"2.4.0-beta10":{"name":"use-sockjs","version":"2.4.0-beta10","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta10","dist":{"shasum":"c6f23e16badcf1d2524f9118c98df5c655c8e7ca","integrity":"sha512-bPuePVJfe7UoLIT6z51ChQZPj3r1AaAGyBhg16ibe7x/gaPhwYj4Fs+wgWXVDS90cVKAtW62RpsyuxPrVtPLzg==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta10.tgz","fileCount":30,"unpackedSize":21771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAktaCRA9TVsSAnZWagAAGgsQAJO/ZdkEgB3X+9eUor2i\n809acIzcT7ACjTmPmjaAjXoTK3TIFFPKxVQxWS6zG1629eWB4E+HELc7VzBG\n+iG68LIib4vh+Js3CRpvqKmWywPuoFvQCnoCWgJF+sJQ21jl/2Jd86xVxTEn\nhbzbSWqGbrKMDq/P780ufydrtUFX6CY9rIske09hTgV21TPYBXDKCfP82fYs\nDFrsc3M7rbkSH638barOqlInM+CKuBW/QvKcr5Bg6rVElF6ZFel4mrMUNDat\nzjevkHuTFxndp7Ki3P7mNNphmvSkywUylfOSBzYsDgaILmEqtrCYKiiEb5ph\nBGfaV/4S9WgpnrR8kstqtyTm3ceUwL2tEljkijx1a8xKTI4K9vf/eNnnoZoF\nXRA8IErEpQf08A6botP1mHeSZSalDxibsfkIrDRwERqc1GF8jYRBxIFI2gY3\nTG506QcH2OpCtFsZ/ZDi4ynLSV/NaVCbVhzaosh6/LWSQkpgO7L6/XzOcOwr\nfrBRwGRXDhzzIOMfmzZYhu94fFHPXaF+5o3AEajba0SYKIZE9KzcfNE13Tlb\n7SmCYcX4BD73zfVe+cOu5o5kmfvA+YQ83vkfxJjVAoP8Kmy5JkyCFz8yXoJS\nnB2JHqsuXDpUu0TId0uotW5vFghlz9gRsX10EnBWZVGSukkTji1bLtfuerV7\n0MUH\r\n=yhwI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDL6FNLnhshE8RqyWQTNdFxu7cWFYNL61c6gXXeY9CraAiEA4rWpnXGE+fuBTcE1yZCvRZJOwocoGc6JiyUFNeNaQ7k="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta10_1627540313904_0.175883541943203"},"_hasShrinkwrap":false},"2.4.0-beta11":{"name":"use-sockjs","version":"2.4.0-beta11","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta11","dist":{"shasum":"1067cdd82dee9c85f0b23a44128002bb23fc3cfa","integrity":"sha512-1837j1XWmWrFJkcxiQgFEg4LzCOnqCly2Irv3PJFtaaNvUrr+vNx//PykP4B31vPciYLwq4alo/DQf23hnQEfQ==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta11.tgz","fileCount":30,"unpackedSize":21710,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAkysCRA9TVsSAnZWagAAg1wP/09TWrE0UJUVE0p/mFvG\ncgn2ZNyEnZ+1N3oXiygfw1iulk88iydOvWss+ul3qqSaqCrCzYPl0M44C69F\nb+1+MrDFa8OUVUIFhRThs0vgjgCe3IljnMt7OksAh7y4b/QPJTIHfTBRXmsr\nSxKYn79EFXvIjR6q0pihwiiwMtxnvufFHsH4BH9K5kTykW8OEfJZkn+lBP5q\n+cCkqJx+SAgsrJsA5e1HE5o172vjZGXCoPy6Bfvzbn4ttNJGFARZQV/04SNC\nUoN0bQKr7YbJYNgpCuSayQpr0UhvbE16AbG4lHZFErAIjf7xHVXNFhK1mGei\nM9zNXmeIYJtBRy7RN5YsNxFVc31/kj1qhaLZxyY3PofE2guAcHMsSG52Xu/J\nSOlEovGfJbo29WXXVTzDDBT7fjBozoyWxzSpDBQijlxcPj44v7hGJNjsOGEs\n5Lj+FAAceUGQknoajBeZ0TsSr6dlNFiRrztHqaQY2ddX3ItKK0L+Z4lhO1/H\nXHi7EoO6cFrMso+qZB3RybxziUpEGIHkbgDmv/kvA57/HazrJw3iwfGA15Uy\nSff+sktRx/lieZLFvC/smNtKF6cEbzCF14GsrHM8rJcarbBRninPCE2+9bJe\nFMeWCFMbjpxfQpwQWglD9S4loeHXJ2nAeXu2UNF4EC43s7gbM79UTIP/nz7l\nUp4E\r\n=09Y0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYcbMplTqDA/qisF5KjVrLy0mFjdCxwUXxJpR0E1OuWwIhAN1nad1wDQPWZvDTM9MMEqHj7idZZ5zuJAlgaa4vsTXo"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta11_1627540652469_0.056676400416243666"},"_hasShrinkwrap":false},"2.4.0-beta12":{"name":"use-sockjs","version":"2.4.0-beta12","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta12","dist":{"shasum":"0877864f1d72749b0ddaa866eeff37fabcb42fdc","integrity":"sha512-zqXfds8T/H227AIoriVI0mszrjc48dmyW13kx3Bp9bA2FNB7a2dO4iiJycC79ptkA8fsi771A7R4xAXvHxaVxw==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta12.tgz","fileCount":30,"unpackedSize":21531,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAlbrCRA9TVsSAnZWagAAvfQP/0N5dc/0sXn5kSGOF6jF\ntWbfUoZ2A0YQX0zIcK7dyUHZZW4WhYuxqg71qdD3ay+3WYl3apmLllqI9kE0\nuVujOuD6YYOAwD3fBQpqByg9iWn3lQc43WQVlIRKpUwsOClzD3a9V2/b2dYs\nKG6qImkbguU6aYXmnlocd0EdPeYVT3npSClMgtSb9clLJ02PAqG/5Q5f29TA\nMh/jajLvV5ZG0M/y/PpkIWvFQReTRdH0XlhMh/Ywc/NNxyqBZI1Mhwe/eyfF\ncEvorBBq98moSlRCgMeOTxFWO7bkqml7ZSjEkD+fH1OJESdQebSGWVf2ipWl\nK0lyw9EI2w5INir5a4ZcSlJvPDcOOcwYuQ7VTazFu+tJHBlw4Q0WOUMjJaYC\n/0o8LBORwQhjqics7MBkKXeQopFSjqnGD2GFTxZry1Q1czkBuQxAPveLKypC\nY9HAHsSuirfoOFPuRP42mx27LQJOR3k4c21K15ufb4eLXCVaYGLB1oi0DQx2\nmxa4DeP7DSEmm/eDrIqjtenx5cTZTJgaYRd4Jfzed7Nvhhm+G+hI9wYoIl0V\noFHRwEOaBzJRAT81hi5Nxde6t7tdC+CItnHSasNKzCFwUh621QE1ljLesa7+\n27mKiKSFj+WgEc4P+adriZoD4dbnwWZe3seKTEaW4j4zlzqBgGn0ySkBfa4Y\nJ0K1\r\n=vUS3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICTAThlvxl8x/eyUx4JN4//Y5twu1KXnT03vG5YFOoBIAiEAo/uof674MV8z9UrRF4gqCgJJ0GS2tONfqvUCKv0TlZk="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta12_1627543275667_0.15075117822277062"},"_hasShrinkwrap":false},"2.4.0-beta13":{"name":"use-sockjs","version":"2.4.0-beta13","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta13","dist":{"shasum":"49193c1d72b6c5869e5d777c7198c21a4ed692f4","integrity":"sha512-65P/l9gqLRpyNpeNfi2q9gNVJy4cRqamHnkGNCrFhrQyh26tt+1MFY4ixcgqyXJI49U3BMSC5mn1Ai86KjLzNw==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta13.tgz","fileCount":30,"unpackedSize":22388,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAl5DCRA9TVsSAnZWagAAIi4P/1Ju0lCrddUcV3l56u4a\ncnc/WLltZx9Ce3DMZNdMDgIun3vK59C2NCJb97HKjQm74yR+4EA15cF6rQGI\nhEx/UPuZ9yHFLOIAas/MWjFjTk9K06r2/A436aeFFyq7ps6g0hLPckH8EbWj\nUPfJlSK4d7eknRtvcfb+ULpoxvfF7aHybjcuw3UqNo+DTiVrLAdz5VU4gqG1\nXV5+a0ENOgwJT63zvDMgyqyEH97xif06rzO8Q2XF7odA012lzn5YGR4U7zZB\nT/2V24J8R0vTmjXaunXexRcWHX+454b2f1Ba78fyLap9+OWrf5Z3KDXGIzfH\ntygnm6WEE8UtC0wVf3NdDUE/uixyCylS/y3y/iTDcwIJx8P+kdVV5kXjMxcq\nqZkvdg2TX6rdnhS5cIjD0F+GBJ5TMdxzdyya2hA7p6GORDFdGMkgRQ3JPQiD\nZuhwBVVRyCeAzQRX5tomuiChBKJnvxoThGnrOs84gdW/t/X/x9MGzEVZ85rI\nxuptzifeMHOqhpZ9bFfjOASCSlnAzv/PiYwu/kTDrPKvblvbrKP2F7mwQdIy\nB/vYMLaLwvLKE7yNYt9qaOaFkWz3y7hI8yigJkgPtENkaXn4+2iHnL45Drj3\n7+FgdDUlDIW9VKH/qxnvoMlDCyM3msFMmeKklODfAroCNMzXyJLPFofQjc0d\nvOcO\r\n=s8o+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGEOJM51eetTDa1ePzUDklgn9W48hyK4pxCl2xlb00pQAiEAz9UWV7RWMLbUvUzVhi/Ep7jfPf4b/YWhMkijGqUzLd4="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta13_1627545155506_0.9276184157931662"},"_hasShrinkwrap":false},"2.4.0-beta14":{"name":"use-sockjs","version":"2.4.0-beta14","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta14","dist":{"shasum":"8ca8e0756653e1cf68f6a74b9ad67147967652a2","integrity":"sha512-W2Z/OfLTR3w95G/Qun/VIfaAL//DDKkelFZJJxkYRjFIhAuPlXIrX3Si85aSjcydGoia/ZQjUKeRJQ3Pfi6mfw==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta14.tgz","fileCount":30,"unpackedSize":22660,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAmBiCRA9TVsSAnZWagAA/kUQAJUq27GTq8GTLPHZysBP\nwLT4BIUhnLudPQ6qCbJTM9HuStGZThJ5CUuivQJCAgqc5f5VhN0snQYzvpj8\nIfBizqd4ScCW7l7izTZYOkYhN1PSxVU+Wjz4LvNkA2uo+j44+t/M4swjSd1A\nrMHBE+zSh4MbyRZVkw0eeefyyA8fPjRZunUNMJdGHafYxqhLHmWBSjd6ubQR\nHlQ4suBSAuoN9ZUHBiy+mFc4CCqTK9rZsJ98uY6MrbIpI9/5m1V+FE/3evaR\nXnzPW/C1kRkVqEAjG/OImwQH4RsI5rlIjMSndeTr2/EQCvxRmLTPx+OjBRbe\n38dlYxPyjs95CBTpkedhVjSAdTNq+0YXIhUokgx5kCFzTeFI5YUpYmnGOhRQ\nq4zCBJvXLj742X/wGJ7BQEnxcDSsWa/dFid9NbK74kdOpzN8sPA5TynDWjG3\noBeGpNB9ooF/L2VSq606J+7t3OsmrKXDL0xAb0a3U9IbIgRp3wPsqX55qKM5\npMCwSEidPCQ4a6YvH6KD/wUnIvMLcfpC5+82YoQfluX3ShFvocNyVU+CndTx\nn1GO9N/YVHnv5hT5j1hS4hoMjHFQPNycB4mnl4z0c+/SXEH3fxYwyVbYDZnf\nBg10e6zTX58juPEXmYQHOFqf9gM08i0QjddDOZb5k+T2AG6BX6kITE7WKjaG\ndXk3\r\n=Sxlu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG9kthXqExCLAY0l8l/kscXAKzU5asqRYlA8Df8TiPBRAiEA4xCKxyDg9IcgNbOthejs9z9tBGUp0PUuORlksSOIkX4="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta14_1627545698510_0.37643858884778414"},"_hasShrinkwrap":false},"2.4.0-beta15":{"name":"use-sockjs","version":"2.4.0-beta15","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta15","dist":{"shasum":"3561fe600df2b7c53df18337bbe0c9e8590b8988","integrity":"sha512-X3alcRb1pPCloi7smj65ZRlANjyKoRsGQGazdv8KdJ/HmY14SYv0RsH8Kgf0nosLbLwBO1P7kVAEDsByBifTSw==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta15.tgz","fileCount":30,"unpackedSize":22949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAmI2CRA9TVsSAnZWagAAYgsP/jtn0OTRx2lQ2OqD6+z6\n5BA3tHBzxPliV4SFrnvgNLhGWl/JBtlBSEH5BL8zIVbYP5rrs8DY5xfYu4pX\nTDYvR8zi54hUxMbq1Y7lfSuzw4B4OIwgR7f9tQLe8lpDU1c7Xc8p7NwbUhvK\nHkPX/WgKR9eblVRlTphQbHeOLM1q8IEoLHmB6M7O+eGsOygQuBj7TrNYlt6l\nOLiqO3q1B2+xsvmstfx7Sv8MeoZswrZblE5OTTJc/TdGQbAHt/+HkvrCwe8l\n6R+yJvffOYjbzP56e4dT0xoyPREjf6z4TLJdNk03SeiWLeTcjYSiwWNfiq6N\nebcshuGHrQAbvrmrmEQfiBC2vwXscZ2cxSn235yYqun3taw6edh901aOVMpF\nKDYxHosIDkdyhW15RIu7FKJOob8EW3prf5PHEyZC+4OGzdE3AXD1yVDdMtYj\n5xwo6HSQXbnPyYNMWv0sHiflPgdqrxDKjsv7dv8oZfcbC8Lbtuy/b9MzbvKh\nW5cQ1eZihzk/jVVWQXpUlHb5LVy+s6Pc2S6DmiDqFeSInwFiTLOEis3xRmfV\nQmZaWtIWUtk3jyOkG/3zdH1qpsLsWlhs1+4x6Vc4sdc5uMajM3DCNHYXX3hP\nzBSvlzfhHxnM3u6qEcN1OmNxhu6HOoydvedgFfR6pIJlafSjl1AkaY11AHHn\n4p2r\r\n=xIHB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEG6ZRTVLgaNzNfpkTOK28HewLBakSINQ3Pk850L70oFAiEA7qDMEjkexMuvZCD0ZQdTCs3boyl2g3L+CGsMRtYpUXM="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta15_1627546166352_0.004781878001452355"},"_hasShrinkwrap":false},"2.4.0-beta16":{"name":"use-sockjs","version":"2.4.0-beta16","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta16","dist":{"shasum":"8d6b0a16d5f320ed4710e496bde9043b3239d71a","integrity":"sha512-oVCWXGI65Swnldatz08wUI78jvRllsd454C+N96/bxPU/PDuiitRbP9H0eTOtqhur4EMCt+dp021jPs6jrRyQg==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta16.tgz","fileCount":30,"unpackedSize":22924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAmLUCRA9TVsSAnZWagAALLEP/jmYKdwpGHZvkjwhHZ6s\niAr/9bh82ApAZXXOSE3NQ8K6Dud1t3KlMj8jF/AoJc7HbsiUrS38XzV4a5bS\nZa21rt2cTSrFq/2R6ogxMTD5A5Gl7plKL66op3Y4c3uuKZd6WG6vUT7B7vmv\nGfIahr46Lq8Ldp8U1seG5pavMCzY11NXd0WT5jgaypRRNFGXcnk9zHC0iVJT\nzUhhgMaljzsQIJEhfWoRbvraDaa50DYR2wqZc8ZEiFITbDmTlY4Lxp30ZymP\nKg+YmQOqALBJjWz/QFFkx1OC16vZCaoyQCuca85VkB5xlsdMeXh6OpH8J/L2\noW4+hlirp4EwIe9vzV3nJI1aRAfEPm2WC3Y55H7ewvnaWt8BB9LlbXFhKEA1\nCHVHX72HW4HgIlVlV/nkYVVUuvGG6xDBxQOoxKAbQhxvkGXKM0YGAq9L0kux\nborc/XF+ZplkUcLMrp6PR5EBGOf4Kdxr3ZyVUh7xGvtzBFKrYq1M5yeQNv5d\n04h9rgL8I2LxMMnTelknHl5PpkmI7fTx/GPPJSehdfpwR4yifpoNLVkH/XJT\nsEoTVwwHjcize8viSCDvoXm+EjQtXoWbtYV5Mx9CV+OHwi5PROtfvC1FPDb8\nEOryek/y/KVQESl7hGV+h2aumqvRf+G7i/Akl5Hw+8awLx1Y+7wLYf0QrtY1\n5/OE\r\n=DWdl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2ffXpEg39TimqhtMjSPY0be/tqdZ6GaEaoAzoiivCXgIhALr2lAT8M6zkIY3vJg7KYGX23ZgUhN3d58xnOg0kGwDf"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta16_1627546324028_0.4118908714259679"},"_hasShrinkwrap":false},"2.4.0-beta17":{"name":"use-sockjs","version":"2.4.0-beta17","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta17","dist":{"shasum":"327db7de7351c346022e6659b0becc6192eafaa7","integrity":"sha512-BPRHVj6eHEbQNjIZEKJIFvhJKORODLl77qeaHyC9/HJfeTMvb3BmgsF2DHGEay5GxBnS6ur9qGZOYV8LQxKLTQ==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta17.tgz","fileCount":30,"unpackedSize":22433,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAmU6CRA9TVsSAnZWagAAGcsP/0xkfBi7mVpMxF0e+gha\n7i6blfbdqxG+Sq6MQwC9zWndjApzACiyc/IU6j+cXzTsVWX3as76iJReH4Vj\nWnpJOjN9WOKnSKeiG2hAIRXFPF8s4ri13ewdRusSDyrJhwTxnzsAjAnxNXMO\nnqUaO9zkVi6uXooPlotzx+v+ii7PaqeoR/q+8q87WzaNTg+cv+Wn7sm2980K\n6TvpY/5hDGr0MzyCBykUrx5NExSlVR5E1K7K5WJbpC4DiYycwQfyIUzf3Pc3\nW49jCxTQb7W98KBcaMOXMKzJlASvGn+CN84rJdmndrjoi6IPcOHs0TViVnrS\nhhCiZTDz0yh73CohmC8ivveLSZdSyRp/LAlJfrvoUwZ+494bqB/taWzLJ0Ea\n/OrOtBmIEmU4r5IlmCWOLwDH0a4y/ylc8x/YWSQEfTXXwdOALgD0UmvKtZeq\nsI7TBk5DEvNdcgDYSrIepBd2ascIa4AFpDcVQIEbS3Zo1G9OpF0EnbbtMSOr\nsq9jW3oQ5klnbBpk+07ZNLjy87XrUx9RZUKseAYFg6bNsGQKoq63pYohj1FF\nHH1O/WktnsskSvQ7PbwJK8c5aJBc4Etqw7BUAIqH56mUzAleq8NEpeu/twAr\nFAGPp7AE2UCFwqJ6+jpus6OVw8cazU2u+hm8BCGFFM+XjpRtZHlfhZ++P8fX\nzXhw\r\n=VWGd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAQPjIwMw8nAGfBAtwebCEpddxBNnywk9Cgb5ODtM+miAiEA2Sc436wmfkY+B34URsZJ2873Tg/DF7IECZXXb4YIEpY="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta17_1627546938203_0.8191502471849164"},"_hasShrinkwrap":false},"2.4.0-beta18":{"name":"use-sockjs","version":"2.4.0-beta18","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta18","dist":{"shasum":"ec8465f323eecf2a5486e8c515b67df6e851e735","integrity":"sha512-TSJFICr6HA0kEKC2MudgOy0kxcK87I9/HHqi+yWE+qhLacA+ZNmSgzVab8XTAMsifBL312gen5tyDKoJsnNbkw==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta18.tgz","fileCount":30,"unpackedSize":23334,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAm4aCRA9TVsSAnZWagAA+jQP/0+QFsBWqiQvQA2LYSXB\naZ0c9X5n9xwu9aLBBJ4epDJiwzOZZXJ2C/RDxWtdPlZ3ig490LlAsGrOsK98\npfTdyeqiOkGiw8rYQv8674oSnzLchavWqfxEF7DrhmnJAUArGj1hkM/w5P+S\ndxEjznbQDzRI9Z7dlTvgI3HPfhyyyrlhakfrzfDf76774QxG6HUU7YsGN5/4\nR9VSp5JAMO6+LSd40cA7lf5+rFirNRuVHC83bUgJ8+S3C7e4oqvCgYCm3h0t\nqZDRM4449f+7q3hpIxS7nAlmvk4+bsGP04EeIkC8wWToaXGwAV6QmbSMsKRK\nhxl3J85OTGq7NdLoFKhWiqArQv8jCVOXOZMeLc+FEmJ9+pvnI0OfcI9hSW5J\ncP7OblRYH02c2fnxMbyxZjjM4AxnvZcM2cE77kTG1X7pD0nXN++a/q4TKje4\nH2nHy7UiSmw/tSxjvpqdUPgokC+o0NruCqfGBhY4a+zdrGgtJlbvkoM1YVIC\nBpi0ERvQYMc5eHPSucdm3pUX4n+XDZ9uFz6m39ygf7CyjZzA08nJ1yGtIj99\n8LVB1Bs8AJtpH5b9Hsy+RHOKO9xEojexxNcAhJ8+bVzU32d+bSTSu4tTiuKM\n9GwADGXSXFGkFvn/znZxyFiAwizp3Tl3XETTTORTnvTCoUB6JAZLfjFAKf97\nwGKo\r\n=LNEV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7jeiC3ROK0R74GQTEREM4xA4nwQaTkQlmT9uqTC7zBwIhAP+sYcUEqLqydHz/l5OFdgIi/U7paPkwDFm/YmEuPRnu"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta18_1627549210357_0.303823658722276"},"_hasShrinkwrap":false},"2.4.0-beta19":{"name":"use-sockjs","version":"2.4.0-beta19","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { client, connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws'\n    })\n  }, [])\n\n  // subscribe topic when client connected\n  useEffect(() => {\n    if (!client || !client.connected) {\n      return\n    }\n\n    subscribe({\n      destination: 'destination',\n      onMessage: message => {\n      },\n      onSubscribed: (subscription) => {\n        subscriptionRef.current = subscription\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [client, client && client.connected])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0-beta19","dist":{"shasum":"1003001e9dc0b0fae5ad8a7b7e5ca41a5362f557","integrity":"sha512-gvSqwqCpTU6sJenRNhBxmiBSafR0+1gK+pX9c7NYv3DwB2mbJSjf3CyvfquQ/8XoQ0h8ebMh1mzuKufouK07Sg==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0-beta19.tgz","fileCount":30,"unpackedSize":23150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAnKjCRA9TVsSAnZWagAAcycP/0yI846IArg52rupvZA8\n4nQf0AvpmG2MXJZpML7Xs2h8+oCAjn4WBxcJ+5q1WtMQ4/DumlegABvuCxqj\nFk/RdN/b02G2UeXeidW1mL3OiewYVlzdz5aNdxG5pKK9aj1qbz23uFO7sKqD\nV90bZyNyDzN/WeOJZvbflJxwvvNaq+b37MPerAtmeuKb9wy0oMOYPS2P6VOZ\nY2XZ9pwxUyb/HuGIxpGpDKujNSj/S4aTTqtA16epY0d8HYgl6E5U/8d67lZP\nxnVkDZfLzki3UtxIdAUkIJERC7PhOeU+7sWSS+i3o++qnJJRGKOmFZVelUW5\nPdAQ6RRJIRRNec/SjlurLeGOUK0m0JgAj+5gJLJwQScf5uRxhNMO/7hKzTSQ\nXDZEBDVqi/g41LUWg6haGwayq8AXQxsnZSvf7QN6XM8xwssF2iXSk/xvkEmR\nzZ5bCQXcpyXgVBRKca5rR5GQ6kz/2fqnhwYBaSvVpp6p6fJsLEwJQMNUxLjQ\nIFYkUoYCQQBjZM/E29au4rNpO0C4CfKQMhhmAup8J6aAkxej0ro2V7860VIY\nINegvsNc6sO95fssGs1IIawK3uyCvtDKFrSnwdpqmmbutUbjaGlgD4nPG7Qd\nct98s16fi7q+gSZU1ensEfRvDhrqbDiry5Yu3VNJcZzMEyp8GZw3AL5AYnQD\nlQrn\r\n=ma2l\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8A5QIm9X8reZuxif19D4EKylapaNm31RFBPC2qmOdgAIgEKS3smPC3Cm8gWwtj8tx2wvhytpMMRp9g+PSix9mnjQ="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0-beta19_1627550371718_0.9964977701766382"},"_hasShrinkwrap":false},"2.4.0":{"name":"use-sockjs","version":"2.4.0","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.0","dist":{"shasum":"b6e53e2f4a6b64abab5139cdcbd7fa15f434fd1e","integrity":"sha512-/1mr6x0dpVxdDw2I/RP9cDMjMPMG4+e3cVDF90Jas1mnWhZmoQ2E3D9wzGi2KqIcAttUmOwPrkob3IjZTCgv5g==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.0.tgz","fileCount":30,"unpackedSize":22603,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhAngzCRA9TVsSAnZWagAA3pMP/RTWIrOfIeF6lbemPpbz\nbae/dTJf+W/yEeoMnSz5nh3E3drtA6/eMYfZJKW1TDf744ZsJL96np+O9PlC\nwsv5YdvsCcFxKAmXJBPPxDmzevUUNGaEURm9ZBKc88sVm02X4tJBiyPoPos/\nCRxN+dz4+T3uANWu2hv6QjC9zJH8GFa/S3XoLDfG6XPf86R87+Ic61thWQrk\nzIB7dt8m8BjkLyNLQCKh9ZmmQpkutACTNvOc8JFHvqYGdd5N5YKSHv2nffKn\nXbiN/6x0xMMiQ+jK+/e0rwMEyCjGhHx63dxWuWpxSn/kAMr6dIbHGhhYMILf\ntQa9pbRI4hBREBLXCG36m6c4HSEX1QuqPyuHrognNS/813upaE8M1RkwTDLn\nJmoEaX99SYg3AMeCi93vSWycaydS2WDvCDSzn9B4cE5ymWi7jiOKzZdBUOLu\n7BtGjxprSUDGGk51kZ2+T1SIYoBOd08SFWJlfITPNYc6eoOPwof1BS2OEULN\nJEQTV0LH5rOv9z2w968wUlmJNhccZR2/Dg+s8B/JvSwQ+DOX7Xz3o2SAFOik\ny+4+0BL/cefJErAl8bSEVPhvLiMaPGg0oBTd9h8nz4q4YX2/APOQBw+jO9Z7\nPI3fnTWP49NLvOh/fwqmn2czcHtU6V2ds6ww1vUzQC57HutQbCfx7tLDiAl6\nxJx+\r\n=xni6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsJN8cocDNrCky5DSfFOn8tGKgxqN2nOLVA8GTBQEYsAIhAJnnHC+SQ8TCeljfcVq1HNR16pttU9k9ysSoNLZ9mEHx"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.0_1627551795281_0.19600304115000067"},"_hasShrinkwrap":false},"2.4.1-beta1":{"name":"use-sockjs","version":"2.4.1-beta1","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws',\n      heartbeat: {\n        incoming: 600000,\n        outgoing: 600000\n      },\n      onConnected(client) {\n        subscribe({\n          destination: 'destination',\n          onMessage: message => {\n          },\n          onSubscribed: (subscription) => {\n            subscriptionRef.current = subscription\n          }\n        })\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.1-beta1","dist":{"shasum":"b9dfda77e16507c34c26d001088c2983e8c59ba7","integrity":"sha512-ZJS0EeFiflMcK+u3wmuHzHYp68za+3sULLoqR+gdTWH2eYeXifV8RdT/icCRIm0dHdQHNh5zkhra6v2kvtI/wg==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.1-beta1.tgz","fileCount":30,"unpackedSize":22844,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBMHrCRA9TVsSAnZWagAA1fgP/0viKgwtt/wNdofTQ7aI\n1SeGlApW/7Ki11RgLcskQj54eJDlIWfWiT72E06BwncLJF3ms4CornOExuv7\nk2tw93snY3gYtDunH0Rw0fbd/V+4Ok6Dte6j8uub/xGMYWfba9i1ao7jXFc/\nNmKhZ4wL5IDCSPiHAiuebzaihHObWZ5P5KLjLFuljFm+s5T9RoDGpvgfoGg0\nzTOUkZ5XOfo2LWtzFWb4WnevtWX3LSMwRxkr4DUGTZTHLgPalrsKl6OR9c6d\nP4WmdNPMm9Mum9Frp6m/FFyBixiwvnIdtmsEBZcNPQpD9BOQqjz+AnR9pF8o\nXRPnLBwH8n8+20378SRUzn5jw1Ilrm9qtcyM3f//dwI9vHmF2mS9O0u5ovDS\nvn8D4Y8EgHVeXrfkI1rLiEKQrIydG5zrlDXGyrTq24TxjQd3hkAAMTdQYUm3\n9ukerCL6dABsPItdsOJWPY2aKzt+1XDps7iZOfk5TnhzMo6kGRRI8+z26m2Q\ncJkFFpbOgnuwDpHEAzUQHHPOlZ/t0e/mU5chw5vMOStiuHTX5YvNnOVY8I97\nruDSPEJtNvCWgDF55OZarT5FJrIFmtl/XOPV0qnxB0abZZ5/T7QMhN05hzjf\nSqxVqTq9x6INDVa5HF4hG4GdMjR65EkOAvplkm2XXGLZtizwQi0Sxcgc9IXt\nkiYP\r\n=Jw5A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+Oa4cIKBlru9QPyIXgsMgG145SkPjzzT38G87Xvjy4wIhALMWTL3HSs/gcbkA+07IQJNVYdAoxt0Eoff1/osFCKu3"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.1-beta1_1627701739454_0.41205957738605714"},"_hasShrinkwrap":false},"2.4.1-beta2":{"name":"use-sockjs","version":"2.4.1-beta2","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws',\n      heartbeat: {\n        incoming: 600000,\n        outgoing: 600000\n      },\n      onConnected(client) {\n        subscribe({\n          destination: 'destination',\n          onMessage: message => {\n          },\n          onSubscribed: (subscription) => {\n            subscriptionRef.current = subscription\n          }\n        })\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.1-beta2","dist":{"shasum":"792a758b5f5805cf1cab079de505449575d2d84a","integrity":"sha512-DtjU8Sd6KWmXA4lDFYFFeWc35h+/X1uWr0+sCRgIAWkPYyzOGoTQULdcjcQZ4yOYsw8k+XogPaKA4hieFImrsA==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.1-beta2.tgz","fileCount":30,"unpackedSize":23296,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBMNXCRA9TVsSAnZWagAAy/4QAJm3BjJdohs1tc145gZ9\nvnxa/u/jGDrG2qjlYIqMuKlUXrjoWyZsY/PH2KwRPZcwnLQqE8fYf9lid3o0\nJ+O2L/N7PIpt0ws8qo06YPIKacCp1tKG++8CD9u7Io/GKv4WLrD4uPjpuXGe\nL3ZpzYmSoG9yDV/lgpvpzo7rCmeKeJXCb7si8327vzn40nnfUfi0Q6qF8nYa\nJMUFgCj9wa/sgUzGjW82hw3Zd1YCZhzuvHecTbQgDJQhWV35QDQCXORbAqNo\nHQu2/hJZI+R2hzzv9KwHnOV7nPksF2cf7uf3FgpU/NLwgtBcEQo2piKafxkh\nHGwBwznwJVjOgm0aDVjgy1AfolNLR7nB8mh7PQ5gjNwRTpyuU697o+AqefX3\ne2GLlpWBWxmzcloPQAVHlCtW4J4tyGDx6JcL09xPWuMl65Ifz14cf3HgPYJL\nTew+8KEt01PZLKF4pfi8q2y1Rp9TI9eTmQJ5VbinoCIQIHXLrEO27fXlSikV\nhGgToB0tnnLZCiFeNvfx0UFDWZVUJhgVio4F7rAQ/lJrHBNsdjOcaLpIWASz\nNX2zL6T+cIYfuc9nh3kAFJN6cBzbvUMey9H95yK/5JGaSVby18J5jg9a9Lga\ndRlbbhEL2jsjGULmBz9gFfyAP+/dtFtRmuY9qT/ONSAyWVT0WLDAtki+VN2J\nu4oC\r\n=mXUI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDx8H4djnCT6WRkM2qAnBXyYuu62ag1RV+hF6wH9f/MugIhAJFDhXmPKRkxemw1IxH2JoXnNf9Ra9o6B9CGNBsCvcpB"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.1-beta2_1627702102997_0.3588417746942234"},"_hasShrinkwrap":false},"2.4.1-beta3":{"name":"use-sockjs","version":"2.4.1-beta3","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws',\n      heartbeat: {\n        incoming: 600000,\n        outgoing: 600000\n      },\n      onConnected(client) {\n        subscribe({\n          destination: 'destination',\n          onMessage: message => {\n          },\n          onSubscribed: (subscription) => {\n            subscriptionRef.current = subscription\n          }\n        })\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.4.1-beta3","dist":{"shasum":"f4ab98e77b6c173b3ac9271e31e23ef1d40f014b","integrity":"sha512-EVlo6p3Xw8hz0/AolSAbNJNsbKng1m140vucj8bK6kWdpw6jYRYcrkppgq9BVrw4P2CJCQRb9UR5v+cAc7Q9SA==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.4.1-beta3.tgz","fileCount":30,"unpackedSize":24434,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBP90CRA9TVsSAnZWagAAOy4QAJv/GQadUPlxeV77MSeh\nT7y/BUTTGGhs+7Ka5dQmH2flmiviccBErwIQjySmVbZmQAgyeJoNcCYUgCn4\nMql0jzxJQFmTtgaExvynEv+fIq+R2yv8OpAivSSzufllTZZYfY/C/uwnK/V8\n0acAd09NWSvq0QN6+xbKHWYwv0hrD47mE5zV5A+KR2HC6RGzZ5dxGx6RRo64\nDXmLAS8dZstu1JU1Xz6GgIvck0jPJphv1K1SJqYDWyYzRoUJZkkG6OC0TcE6\nGQjpR1orji8uc0YHha7cAgnDtaRmOxwO8MI4bplkTjnLQzm2XAQoj43a0d7m\n8qiV0C8ilQmWiudiD+klsZWLZytL/EAgWDwE2PT2p5iXQdrzm/a/+CgH0ZGw\nNjrGJc5/6fP+4xLCxZJD0wu/ueGZNhk5l4i/z0/zmqpjD1t4XNbTh+EtBlD6\nvd2Z0kgHa8hubFszjjY+lduv4kxDTMBFDRD3AdZTeBlyatRfkOra8H7ldGkG\na1MvWnQe8jyhamwM6hky6ay9J09bioBUh3D89Too03zX8Vgd8k+dGWVtav3H\nrz8u/rZqBbvun1P9GWOvNt0SBi5uIphwSE7r2sqn1EmDUwL1YyOcf1dvXtm7\nHji0PoCCdFO89x6YmqSxGTv9MtPjY13ptzgieya7XPTo2NCBkWl8wMJp5o7x\nHKO0\r\n=J7XG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID7wSZ/vtJXPREon/tFVSZnsBMB9vZRoI19bNiM5TMiUAiB4W4uhFpr2ZCoYF67h4QWbDRXtZXhUAHknpivSkmffwg=="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.4.1-beta3_1627717492740_0.2854375231087416"},"_hasShrinkwrap":false},"2.5.0":{"name":"use-sockjs","version":"2.5.0","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"^1.4.0","stompjs":"^2.3.3"},"devDependencies":{"@types/react":"^16.9.25","@types/sockjs-client":"^1.1.1","@types/stompjs":"^2.3.4","tslib":"^1.11.1","typescript":"^3.8.3"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.5.0","dist":{"shasum":"fe5632464e0b41be586caba1c398706b37966603","integrity":"sha512-xzGJh9c6uUjRG91k/undSssBMxec4oWWCRhR5g6TpYoONXgLIExAzk50lhtcEphHeGjdZsuo/f9sRANc4DKlDw==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.5.0.tgz","fileCount":30,"unpackedSize":24428,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhBRhHCRA9TVsSAnZWagAAY0sP/A5PIhPjpiY+TeurEGMr\nZF59fLYnwqnfe/HDDl665xZc+7BD3edBF+V21UJc9mVx0YdxCfZGTLD8zmXJ\nD61JKMMX8+McnxHGl8lNkIJ8txNquJ7NER71bHLsIuBmEt97r21dTmvn6FUn\nlMCQoYROLUZtP/E20avBzE5069gV/3eVtd/tjodiCEqdb4QRi9RowrMKy2Ra\nCZzJZavNLCuveKZQISr172nS2dHG5BrrFt4qkwVQBo5EtfIqf1Yz+z5Wwuzl\nFNPDwSDfslL1ZekgInPzrBYY7HQlWhQUlO/Ux9+vOSgLmpK8T451UjhkPwoy\nwOlGXQ6lTul/7cdc+YVMyjTPFv1QkHypDkbUWlz1n620lZvfIebFgt35JcU1\nloP6jMtxE+mKfrBldEexLngFNUR4ZY4OI7p/is8wdkbJDUUXbkD6yQqBLN0u\n/EfvX/5kGfRBw0fp7CpDhIMYm3ZPB1mRLRRsNWhtHr986PNfoxr0vr+ODj/v\n4FaJmyaimDH0WEep3pRXt4ou/Ti4XzMe8CM5vAD9eMv+g6YS0SB/B2lE49JK\n/dvKv7pVlrDgrs9msgpyyyxIGLuyxfwxi7aw1iO5957Xt5BznSyy873GsnYS\nx+Ml0YnNtdJ85EPAnPI6PjXESiZmECYlndAFt+mRADZGzwHVPcr2q8zdqYVB\nkDW8\r\n=ZjKY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDs8+tEpjsqU2N3vbopfsxQGxu1EWL57USYzkAkjdEF2QIhAKGqaCsNVcjqakqzXmi/nIVyqIZvUd5HxGc3AC/zv29k"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.5.0_1627723846981_0.8125265948751519"},"_hasShrinkwrap":false},"2.6.0-beta1":{"name":"use-sockjs","version":"2.6.0-beta1","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"1.5.1","stompjs":"2.3.3"},"devDependencies":{"@types/react":"16.9.25","@types/sockjs-client":"1.5.1","@types/stompjs":"2.3.5","tslib":"2.3.1","typescript":"4.5.5"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws',\n      heartbeat: {\n        incoming: 600000,\n        outgoing: 600000\n      },\n      onConnected(client) {\n        subscribe({\n          destination: 'destination',\n          onMessage: message => {\n          },\n          onSubscribed: (subscription) => {\n            subscriptionRef.current = subscription\n          }\n        })\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.6.0-beta1","dist":{"shasum":"26fb7b5268170e7a336ce661ab368830089b31f1","integrity":"sha512-SH6/Iy/LdMjf3Bwa73DX6veKjRU6SqMECHfCQ8EH0JgbrKzg7dbcPWaumMT+RpAXDjDWtIfXYtKHXP7PatVHYA==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.6.0-beta1.tgz","fileCount":30,"unpackedSize":24822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFuvfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmow+Q//ZbfgrbEIVz1BPaGpeMjjMCv/s+UZ/oBJFUW9yageTWUTlbnk\r\nhqSJ48ClC1/CLpsB2A11DdK3Q00VyCx1zoOxntBrmxcWN/UMKceY/v8xy9Mh\r\nG3lSPX5wgsWTNuyO+2SD7ALwdbQbri0SYgl2lZslTauqg/tR9BClwpY7pYD1\r\nwwjev19Xp8MSZcDnVaSZx2WFwBTTxnycSDEa9zWK1rHuJUfcV/TdAHEHP+Jn\r\nxfpJvjmT8vzurlN2Jp+TqoENt7bfhBvxuDIGLo6TAPa6idyo3attV3O9AkYc\r\nixJJ8p1TW0mhYo4Qeh57GtPmxnfDL6VdEQH6QKO6AFS7sH7q5RbOtTAMMuBz\r\nzPMwO+WJZh9ZxnrA1w/tuRXzawhksCUMqF6DW6Uu7TRuk/Z8UkTUQEDVOrv/\r\n46zOWGhOWWXPFbugZ6ViWzJkX6mmu1y9o4U2XqZYwnC/b9NtBC3LbK8eLF9A\r\nc2tM4bLi6SpOJ7b4lHmishieQh5/bZq/chJNEvUDqpMJxuLhMBZqgtxFsbhK\r\nJyGk6ktoPUW8pJFcxXQ4Jgm+s/Qhj+930WLFfnDWB/7kAj0O2gAwS4EBL6ZL\r\n22CBSMAA6OsUJ+VdZBOZ+yM6vWkzbwXSw9H9wbI7iO1gX7vB7FilRS3SqIg+\r\niv33a4w8uRhwY8mNVwD6x3vrTOG9iDrW6fo=\r\n=mjTY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC54xOINr5kWAOg2ab1nDutksbUHCJdxuDaL3EWf7yMlgIgcOtcqvyBz/uS8Xr5qqWM8QZ2Efm1cM5JrxYRzH+jatw="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.6.0-beta1_1645669343137_0.8788823184492418"},"_hasShrinkwrap":false},"2.6.0-beta2":{"name":"use-sockjs","version":"2.6.0-beta2","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"1.5.1","stompjs":"2.3.3"},"devDependencies":{"@types/react":"16.9.25","@types/sockjs-client":"1.5.1","@types/stompjs":"2.3.5","tslib":"2.3.1","typescript":"4.5.5"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws',\n      heartbeat: {\n        incoming: 600000,\n        outgoing: 600000\n      },\n      onConnected(client) {\n        subscribe({\n          destination: 'destination',\n          onMessage: message => {\n          },\n          onSubscribed: (subscription) => {\n            subscriptionRef.current = subscription\n          }\n        })\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.6.0-beta2","dist":{"shasum":"3eb656be169410fa21bde01067633b2c79ae68ee","integrity":"sha512-nB/J6pDlKBYo5zL08HYwaNsIlijCc8MqaUa5fmh6WMBcFoVTm5KM5eYqAkl6ICs3OhG/+Eo3QCf0y8R3shAM7w==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.6.0-beta2.tgz","fileCount":30,"unpackedSize":24800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFu3bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYVw//TiUK9RmcJ1WZCf2TLWntkShyilR9KJ8ILXZsTfel0EBa52KA\r\nmDZ7IUnlmBaixrCXKYv706aHSUCL416iModOgs8r0y1VkaX285AAQpEE5OhZ\r\nTevtil+KdjnWALq3PoCf/u3vfOSrNIUoC+GyuUgM9ipm1NU3rL1m59Wy/nQ6\r\n6/aBS8QNPpW0xi8x7bKUXP+bjH8o6HDRayHbnRHdxX6uS13Es1RKx9Mk1TYz\r\nD46jSet+hUY3ZuqhkXL/YMXMvxZAHv8pENDge3q9PU1J432stlhVe+UONleW\r\nbk1vYvrYsly15wvz13z4dvM4j7FrAT1OVIM/KHf087TKBlEodZDAy0m/hgzk\r\n/loxEnTwwISt6uvYVISPNcAFJokfua/d/g7yIofptzhU5PYQO7pteRM5oQup\r\nhgdi+Q1J02+eBIcLNVdk34yTmIrPr6+zW3YR9IZ4I2m7W1Lk2KYJbKhRny6B\r\n3OT+NdyDdejMneE5eXN7bRH3zWNralRJmKq5pJdob4SSMVpxCAHkdv2tt5EH\r\n2VSjIQBEFDfdXZ0/bGwiJjUb36YYxd8jDZIvoXtnuUXBjHgKthln1Vr/kOLB\r\noe8b0DMEOp1JSsFrKvWUjcNMb9SIvcVM7nH+R78zLhWbK2Pz4B1Z1D+tjgOA\r\nN31gx0jT4FEW77sGUUbuUnXNuIMZR1EuneM=\r\n=2ISB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC6iihFAA5xxFl0shgXZ1EvFihWiNpcMbtvmrTKJTSyewIhAJ/x4QfrVAnJaU8uAtwykkuPiQ489tKqlkoij+eQcpCb"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.6.0-beta2_1645669851106_0.9949964261353659"},"_hasShrinkwrap":false},"2.6.0":{"name":"use-sockjs","version":"2.6.0","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"1.5.1","stompjs":"2.3.3"},"devDependencies":{"@types/react":"16.9.25","@types/sockjs-client":"1.5.1","@types/stompjs":"2.3.5","tslib":"2.3.1","typescript":"4.5.5"},"licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.6.0","dist":{"shasum":"0cbaddb9ae14e53bf42864b7ee87fe08dacf956a","integrity":"sha512-E3xfSSlZusn7GIXFKxMhLkCnCECvZ7Uu12QM5a9o8V3rTn7g/IvzyX98Ve8kYq6qixXe0HsadjWtVptgSbvnaQ==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.6.0.tgz","fileCount":30,"unpackedSize":24794,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFvIxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqliA//STOMZnnJGxLk7lA7cW9vIOwBJhLUpQoL1eVjYnP1PZLG9gET\r\nD5ZxxHWPVUGlQZ4idfWzA72JG0l2RwVR5lvxxeK7sGTw50egxQBBDzh1inee\r\n3ydhg6bRb75MzjxoCMsAS9tbFymRyKttO+F4vd5YAH6KzY+4iU7uxso72Vqb\r\nU0EcIXsTHOfcY0d5bJQoaD4Tbr6XfckNuydvcjcYzFu18UjGY4LrwVgTuVl8\r\nlFw3UdbrA9VqbKUjBJDAMTZaWfGQxbl/ZQS3qZ4VxJqqDZr6aFlixysgxJvY\r\noVH1R+C+sjV+tnPN2xM9k+9a+nKnZmke5FLs+fbHtu8VENmsLwSac5XXmxFy\r\n0zuwkgD0t548QkTEdlSLOir2AqO8hD1pBVIiBcBb5b4gZDVk7JfF86t2FQsX\r\n1PF+10T1mUpVsnJ8/bDAnhAxa3o9OyulM8CLxFaBaU0NFEGjlaAXkK4VwKhj\r\nLJB0bdopAu9GlkqzR2ojqsYWZiIG00nqn1XIQ2hFpgdIF6mZzLffEVsPhrLq\r\nWGd5VbeBnvO3DztOlKiD8RaVLFRF/uyCI3JhOKB0CE25bZb9wskkL0Z1nqC/\r\n7J22sqhEksaOBfAah8xw2vyNLa7YNmLsmipcpw3AeWFMyUCjnN8F3RfHTGHd\r\nRhGKA4Qc1Bgx07M5G8FAUkz0YkJov5NUlcc=\r\n=ba8c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEVNugNTdUQYoDvwiJKEAZ7xeiSberUDRAzCd+sE1T5VAiEA9l5hbODHdQ5b6Wr17j/Ejn32FoO34drwMDmkKVyVMxw="}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.6.0_1645670961511_0.663731815386198"},"_hasShrinkwrap":false},"2.6.1-beta1":{"name":"use-sockjs","version":"2.6.1-beta1","description":"React Hook for SockJs","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","scripts":{"build":"rm -rf ./dist && tsc --build tsconfig.json","prerelease":"yarn build && yarn publish --tag beta --registry https://registry.npmjs.org"},"peerDependencies":{"react":"^16.12.0","react-dom":"^16.12.0"},"dependencies":{"sockjs-client":"1.5.1","stompjs":"2.3.3"},"devDependencies":{"@types/react":"16.9.25","@types/sockjs-client":"1.5.1","@types/stompjs":"2.3.5","tslib":"2.3.1","typescript":"4.5.5"},"readmeFilename":"README.md","readme":"# use-sockjs\n\n![Node.js Package](https://github.com/darrenfang/use-sockjs/workflows/Node.js%20Package/badge.svg)\n![NPM](https://img.shields.io/npm/l/use-sockjs)\n[![NPM](https://img.shields.io/npm/v/use-sockjs)](https://www.npmjs.com/package/use-sockjs)\n\nReact Hook for SockJs\n\n## Installation\n\n```shell\nyarn add use-sockjs\n```\n\n## Usage\n\nWrap your app inside the SockJsProvider component.\n\n```typescript jsx\nimport React from 'react'\nimport { SockJsProvider } from 'use-sockjs'\n\nconst App = () => {\n  return (\n    <SockJsProvider\n        onError={(error: Frame | string) => {\n        }}\n    >\n      {/* ... */}\n    </SockJsProvider>\n  )\n}\n\nexport default App\n```\n\nCall the `useSockJs` hook in the components.\n\n```typescript jsx\nimport React from 'react'\nimport { useSockJs } from 'use-sockjs'\nimport { Client, Frame, Message, Subscription } from 'stompjs'\n\nexport const MyComponent: React.FunctionComponent = () => {\n  const { connect, disconnect, subscribe } = useSockJs()\n\n  const subscriptionRef = useRef<Subscription | null>(null)\n\n  // connect websocket when init\n  useEffect(() => {\n    connect({\n      url: 'http://localhost/ws',\n      heartbeat: {\n        incoming: 600000,\n        outgoing: 600000\n      },\n      onConnected(client) {\n        subscribe({\n          destination: 'destination',\n          onMessage: message => {\n          },\n          onSubscribed: (subscription) => {\n            subscriptionRef.current = subscription\n          }\n        })\n      }\n    })\n\n    return ()=>{\n      if(subscriptionRef.current){\n        unsubscribe(subscriptionRef.current)\n      }\n      disconnect()\n    }\n  }, [])\n\n  return (\n    <div></div>\n  )\n}\n```\n","licenseText":"MIT License\n\nCopyright (c) 2020 Darren Fang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"use-sockjs@2.6.1-beta1","dist":{"shasum":"dfda9a18a82849dfeeede7d1ff13236b3734baaa","integrity":"sha512-P+GuMhX7dKsAtXf/NutkenshQM3atxawGLevcnblPz8tFEsvEyhXba3bj1cJAkR/rCFYGmmokpby0CJJZnkgJQ==","tarball":"https://registry.npmjs.org/use-sockjs/-/use-sockjs-2.6.1-beta1.tgz","fileCount":30,"unpackedSize":24828,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDvsYPCZRUw8+bbH8TByg0ONNUy6XTalALtxR9yYeV6vAIhAOfEgm/6OjO+p5mxr1EkHReuZwCscSjDnSzfhkLtXAfU"}]},"_npmUser":{"name":"darrenfang","email":"darrenfang@qq.com"},"directories":{},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-sockjs_2.6.1-beta1_1688841491423_0.8654421614858749"},"_hasShrinkwrap":false}},"time":{"created":"2020-03-24T16:51:20.103Z","1.0.0":"2020-03-24T16:51:20.215Z","modified":"2023-07-08T18:38:11.811Z","1.0.1":"2020-03-24T17:00:44.545Z","1.0.2":"2020-04-20T07:48:31.686Z","1.0.3-beta1":"2020-04-22T07:19:07.244Z","1.0.3":"2020-04-22T07:38:32.421Z","1.1.0":"2020-06-23T08:48:23.225Z","1.2.0-beta1":"2020-07-12T16:49:17.573Z","1.2.0-beta2":"2020-07-12T17:39:07.138Z","1.2.0-beta3":"2020-07-12T19:24:14.468Z","2.0.0":"2020-07-13T09:23:04.664Z","2.0.1-beta1":"2020-07-13T10:25:49.829Z","2.1.0":"2020-07-13T16:54:45.616Z","2.2.0":"2020-07-15T03:24:34.962Z","2.2.1":"2020-07-15T03:54:40.995Z","2.3.0-beta1":"2020-07-27T07:04:46.121Z","2.3.0-beta2":"2020-07-27T08:02:26.121Z","2.3.0":"2020-07-27T08:12:19.630Z","2.4.0-beta1":"2021-07-26T08:46:10.968Z","2.4.0-beta2":"2021-07-26T09:04:09.490Z","2.4.0-beta3":"2021-07-28T09:22:17.184Z","2.4.0-beta4":"2021-07-28T09:27:07.878Z","2.4.0-beta5":"2021-07-28T09:35:26.895Z","2.4.0-beta6":"2021-07-28T09:50:52.244Z","2.4.0-beta7":"2021-07-28T09:57:17.567Z","2.4.0-beta8":"2021-07-29T03:46:38.174Z","2.4.0-beta9":"2021-07-29T06:10:20.817Z","2.4.0-beta10":"2021-07-29T06:31:54.048Z","2.4.0-beta11":"2021-07-29T06:37:32.646Z","2.4.0-beta12":"2021-07-29T07:21:15.793Z","2.4.0-beta13":"2021-07-29T07:52:35.649Z","2.4.0-beta14":"2021-07-29T08:01:38.665Z","2.4.0-beta15":"2021-07-29T08:09:26.526Z","2.4.0-beta16":"2021-07-29T08:12:04.409Z","2.4.0-beta17":"2021-07-29T08:22:18.346Z","2.4.0-beta18":"2021-07-29T09:00:10.488Z","2.4.0-beta19":"2021-07-29T09:19:31.833Z","2.4.0":"2021-07-29T09:43:15.420Z","2.4.1-beta1":"2021-07-31T03:22:19.626Z","2.4.1-beta2":"2021-07-31T03:28:23.175Z","2.4.1-beta3":"2021-07-31T07:44:52.885Z","2.5.0":"2021-07-31T09:30:47.129Z","2.6.0-beta1":"2022-02-24T02:22:23.273Z","2.6.0-beta2":"2022-02-24T02:30:51.261Z","2.6.0":"2022-02-24T02:49:21.670Z","2.6.1-beta1":"2023-07-08T18:38:11.642Z"},"maintainers":[{"name":"darrenfang","email":"darrenfang@qq.com"}],"description":"React Hook for SockJs","repository":{"type":"git","url":"https://github.com/darrenfang/use-sockjs.git"},"author":{"name":"Darren Fang","email":"idarrenfang@gmail.com"},"license":"MIT","readme":"","readmeFilename":""}