kamrify commited on
Commit
6279c0c
·
2 Parent(s): b5e621d 7ee9e88

Merge branch 'master' of github.com:kamranahmedse/driver.js

Browse files
Files changed (1) hide show
  1. readme.md +8 -7
readme.md CHANGED
@@ -150,7 +150,7 @@ You can also hide the buttons and control the introductions programmatically by
150
 
151
  ### Asynchronous Actions – [Demo](http://kamranahmed.info/driver)
152
 
153
- During the feature introductions, to delay the move to next step, you may handle that in `onNext` or `onPrevious` callbacks
154
 
155
  ```javascript
156
  const driver = new Driver();
@@ -173,13 +173,14 @@ driver.defineSteps([
173
  position: 'top'
174
  },
175
  onNext: () => {
176
- // Do not move to the next step yet
177
  driver.preventMove();
178
- // Perform some action and manually call `moveNext`
179
- someAction()
180
- .then(() => {
181
- driver.moveNext();
182
- });
 
183
  }
184
  },
185
  {
 
150
 
151
  ### Asynchronous Actions – [Demo](http://kamranahmed.info/driver)
152
 
153
+ For any asynchronous actions between the transition steps, you may delay the execution till the action completes. All you have to do is stop the transition using `driver.preventMove()` in your `onNext` or `onPrevious` callbacks and initiate it manually using `driver.moveNext()`. Here is a sample implementation where it will stop at the second step for four seconds and then move on to the next step.
154
 
155
  ```javascript
156
  const driver = new Driver();
 
173
  position: 'top'
174
  },
175
  onNext: () => {
176
+ // Prevent moving to the next step
177
  driver.preventMove();
178
+
179
+ // Perform some action or create the element to move to
180
+ // And then move to that element
181
+ setTimeout(() => {
182
+ driver.moveNext();
183
+ }, 4000);
184
  }
185
  },
186
  {