iampawan / VxState

Another state management solution

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Passing data to a Mutation

tyshantprince opened this issue · comments

I am trying to send data from the UI back to the store and use it in a Mutation, is that possible?

I would also like to know that

Don't know if this is the best way @tyshantprince , but you could do it like this:

class AddItem extends VxMutation<MainStore> {
  Item item;
  AddItem(this.item);

  @override
  perform() => {
    store?.items.add(item),
  };
}

Yes you can do this