Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async Transition for NEXT #2

Open
chr-knafl opened this issue Jun 23, 2022 · 0 comments
Open

Async Transition for NEXT #2

chr-knafl opened this issue Jun 23, 2022 · 0 comments

Comments

@chr-knafl
Copy link

Hi @mayashavin !

First of all: This is an really awesome wizard implementation for Vue!

I built a wizard and was wondering if there is the possibility to execute some asnyc action at the NEXT event.

The requirement in my case is to save the state of each wizard step, so that a user can continue the whole wizard at anytime without loosing data.

I tried something like this to have an "intermediate" step this kind of async operation.
The problem was that this intermediate state is considered as a wizard step and therefore it tells me that I have to define the stepView.

  saveFirstStep: {
    invoke: {
      id: 'saveFirstStep',
      src: saveData, // is a Promise that returns the saved id
      onDone: {
        target: 'firstStep',
        actions: [assign({
          id: (context, event: EventObject) => event.data,
        }), raise('NEXT')],
      },
      onError: {
        target: 'firstStep',
      },
    },
    order: 0,
  },

Is there already a possibilty with the current solution to make this kind of async transition work?

In the meantime I implemented my own buttons on each step, that do the work and then send the "NEXT" event.

Thanks in advance!
Christoph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant