-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement WebSocket #44
Conversation
src/websocket.ts
Outdated
data: any, | ||
} | ||
|
||
export type EventTypes = 'LOGS' | 'SERVERS' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
может лучше enum тут использовать?
src/pages/Dashboard/ServerItem.vue
Outdated
// TODO https://github.com/donkey-engine/donkey-engine-ui/issues/45 | ||
|
||
const wsClient = getClient() | ||
wsClient.on('SERVERS', (data) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а если 2 раза поменять статус, то в eventHandlers будет 2 колбэка на любое изменение в серверах?
а если у нас уничтожится компонент и коллбэк попробует поменять у него this.pending?
@@ -137,18 +138,19 @@ export default defineComponent({ | |||
} | |||
} | |||
}, | |||
created() { | |||
const wsClient = getClient() | |||
wsClient.on(EventTypes.SERVERS, (data) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нет отписки от события
No description provided.