Skip to content
Discussion options

You must be logged in to vote

So, I have an application written on Vue 2 where I work with chats. Chats are running through websocket and there is a layer between my application and this websocket: our client lib which wraps websocket handling and contains some logic shared between applications.

Here, in my store, I subscribe to Client library chat events, like following:

const state = {
   chatList: [],
}

const actions = {
 SUBSCRIBE_CHATS: async (context) => {
   const handler = (context) => (action, chat) => {
     switch (action) {
        case ChatActions.UserInvite:
          // add chat to chatList
        case ChatActions.Message:
         // send sound notification
        case ChatActions.Destroy:
         …

Replies: 5 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@LinusBorg
Comment options

@chenxch
Comment options

@dlohvinov
Comment options

@LinusBorg
Comment options

@dlohvinov
Comment options

Comment options

You must be logged in to vote
3 replies
@dlohvinov
Comment options

@LinusBorg
Comment options

@dlohvinov
Comment options

Answer selected by dlohvinov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants