-
-
Notifications
You must be signed in to change notification settings - Fork 36
Vue 3 composition-API support #519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hey @e-tobi
Could you create that PR you've mentioned with the warning anyway? I believe I can help you with it. TS on the other hand is not my strongest side so I need your help NB: create your branch out of alpha tag, since it already has vue 3 support. I will backport it later to vue 2 + composition api but for the time being it's better to focus on vue 3 |
I've tried again to make this work, but I can't figure this out. The mix of a default export with the plugin install function and the named exports required for this to work (useSocket() and SocketExtensionKey) seems to make things difficult. PR is: #520 , but it doesn't work this way. Should be enough to get an idea about what I'm trying to do. |
Ok - stupid me. Just when I was about to give up, the scales fell from my eyes. I totally missed to fix the exports in index.js sigh. |
Ok, updated the PR - tests pass now and I've also added tests for the $socket injection via SocketExtensionKey and useSocket(). |
I'd love to see this in alpha. Any update? |
What is the status on this issue? |
Hellloooooo @probil |
Sorry due to the war in my country 🇺🇦 I wouldn't able to support the package anytime soon. Thanks for understanding 🙏 |
Has anybody figured out how to use the $socket in setup()? Update: I've solved it (without vue-socket.io-extended; will post the answer above) |
Uh oh!
There was an error while loading. Please reload this page.
It would be nice to have a useSocket() to get the $socket within setup(). The basic steps would be:
I tried to provide a PR, but I fail to get the new exports working, always get a warning
export 'useSocket' was not found in 'vue-socket.io-extended'
and I have no clue why - this is not my comfort zone.This is what I added to index.d.ts:
And plugin.js just has (provided in the export):
And
app.provide(SocketKey, $socket);
was added to the install function.May workaround for now is to do this in main.ts of the application using vue-socket.io-extended.
The text was updated successfully, but these errors were encountered: