Skip to content

mapTriggerActions doesn't provide a good way to use results of the call #2

@swalkerhppr

Description

@swalkerhppr

Right now, the way to do it would be:

export default {
  computed: {
    ...mapBindings("ns", ["my_trigger"]),
  },
  methods : {
    calling_func : function() {
      this.$store.dispatch("ns/trigger_my_trigger").then( () => {
        do_something_with(this.my_trigger);
       });
    },
    ...
  },
}

It would be nice to be able to just mapTriggerActions and use the value directly from the mapping

export default {
  methods : {
    ...mapTriggerActions("ns", ["my_trigger"]),
    calling_func : function() {
      this..my_trigger().then( () => {
        do_something_with(this.my_trigger.value());
       });
    },
    ...
  },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions