Git Product home page Git Product logo

Comments (5)

f avatar f commented on July 22, 2024

How your store looks like?

from vue-wait.

f avatar f commented on July 22, 2024

vue-wait already supports module namespaces. The first parameter is the namespace and it's optional.

from vue-wait.

razorfever avatar razorfever commented on July 22, 2024

Oh sorry. It seems I made a copy / paste error while making the example and did not even spot the first parameter. I have tried to use it without it in my code like one would use the normal mapActions.

So what if I want to use actions from multiple modules?
Would this work:

import { mapWaitingActions } from 'vue-wait'

// ...
  methods: {
    ...mapWaitingActions('users', {
      getUser: 'loading the user',
      updateUser: 'updating the user',
    }),
    ...mapWaitingActions('posts', {
      getPosts: 'loading the posts',
      deletePost: 'deleting a post',
    }),
  },
  mounted() {
    // get the user data
    this.user = this.getUser(this.userId);
    this.posts = this.getPosts(); 
  },
// ...

from vue-wait.

f avatar f commented on July 22, 2024

Sure this will work.

from vue-wait.

razorfever avatar razorfever commented on July 22, 2024

Ok. Thanks. Sorry for the inconvenience. Keep up the good work

from vue-wait.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.