We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is it possible to add awaitable tours
sample:
this.driverInstance = driver({}); let isTour = true; await this.driverInstance.drive(); let isTour = false;
I want this because I need to manage some states during the tour, like activating buttons etc.
The text was updated successfully, but these errors were encountered:
After trying to find a workaround i have the following solution although it would be nice to just have a method called driveAsync(){
export class DriverService { private driverInstance: Driver; private tourPromise: Promise<void> | null = null; private resolveTourPromise: (() => void) | null = null; constructor() {} create(steps: DriveStep[]): void { this.driverInstance = driver({ popoverClass: 'driverjs-theme', progressText: 'Step {{current}} of{{total}}', prevBtnText: '← Previous', nextBtnText: 'Next →', doneBtnText: 'Finish', showProgress: true, steps: steps, onDestroyed: () => { if (this.resolveTourPromise) { this.resolveTourPromise(); } }, }); } public async startTourAsync(): Promise<void> { if (!this.driverInstance) { throw new Error( 'Driver instance not initialized. Call create() with steps first.' ); } // Create a new promise for this tour this.tourPromise = new Promise<void>((resolve) => { this.resolveTourPromise = resolve; }); // Start the tour this.driverInstance.drive(); // Wait for the tour to complete return this.tourPromise; } } // usage this.driverService.create(driveSteps); //define your steps here await this.driverService.startTourAsync();
Sorry, something went wrong.
No branches or pull requests
Is it possible to add awaitable tours
sample:
I want this because I need to manage some states during the tour, like activating buttons etc.
The text was updated successfully, but these errors were encountered: