question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VUEX action not triggering.

See original GitHub issue

Im not sure how the VUEX action name convention here. I have been testing camelCase and the VUEX action is not triggering. Maybe if you can give me an example on how to create a VUEX action.

Also why is actionPrefix all uppercase and on your old docs you put lowercase on action naming? Vue.use(new VueSocketIO({ debug: true, connection: SocketInstance, vuex: { store, actionPrefix: 'SOCKET_', mutationPrefix: 'SOCKET_', }, }));

Also I made sure that my Node.js Socket.IO is emitting the event. Its working on components but on VUEX its not. So it maybe something on the VUEX. Maybe I miss something on the action naming convention. Maybe you can give a detailed example.

Thank you!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
yabuking84commented, Mar 25, 2019

I made it work.

on my VUEX BuyerInquiry.js:

actions: {
	...
    // supplierNewQuoteCreated
    SOCKET_supplierNewQuoteCreated(context, data){
        context.commit('UPDATE_NOTIFICATIONS_M',data);        
    },
    ...
}

so it was just my naming convention on the actions. before it was SOCKET_SUPPLIER_NEW_QUOTE_CREATED then renamed it to SOCKET_supplierNewQuoteCreated. Now it works!!

Thank you!

3reactions
evanbechtolcommented, Mar 26, 2019

@yabuking84 Be sure to close your issue if you have resolved it! Glad that you got it working 😃 It may be beneficial to this repository to update the README.md with information about case-sensitivity, or more detailed VUEX setup instructions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - Vuex mutations and actions not working - Stack Overflow
Save this question. Show activity on this post. I'm new to Vue and Vuex and I'm trying to figure out how to mutate...
Read more >
Vuex action is not working - Get Help - Vue Forum
I have a vuex action which I am trying to run but it is not not working, when I check in vue devtool...
Read more >
Trigger a component function from a vuex action/mutation-Vue.js
When your action is called, you can modify this state boolean. In your component, you set a computed property with a store getter...
Read more >
Vuex showdown: Mutations vs. actions - LogRocket Blog
Mutations and actions are essential parts of the Vuex infrastructure. In this post, learn how and when to use them together.
Read more >
How to trigger VueX actions from the backend? - Medium
Actually not just with VueX but any state management system like ngrx or Redux. This example will be specifically about Vue and VueX,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found