Skip to content

Commit

Permalink
Return step from addStep
Browse files Browse the repository at this point in the history
Fixes #165
  • Loading branch information
RobbieTheWagner committed Jul 7, 2018
1 parent 534c9ce commit 26a6317
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const myTour = new Shepherd.Tour(options);

##### Tour Methods

- `addStep(id, options)`: Creates a new Step object with options, and returns the `Tour` object for convenient chaining when creating multiple steps. If you'd like you can also just pass an options hash which includes `id` as a key.
- `addStep(id, options)`: Creates a new Step object with options, and returns the `Step` instance it created. If you'd like you can also just pass an options hash which includes `id` as a key.
If the options hash doesn't include an `id`, one will be generated.
You can also pass an existing `Step` instance rather than `options`, but note that Shepherd does not support a Step being attached to multiple Tours.
- `getById(id)`: Return a step with a specific id
Expand All @@ -139,7 +139,7 @@ You can also pass an existing `Step` instance rather than `options`, but note th
- `show`: Triggered with a hash of the `step` and the `previous` step
- `start`

Steps are instances of the Step object. They are generally created by the `Tour::addStep` method, which returns the `Step` instance its
Steps are instances of the Step object. They are generally created by the `Tour::addStep` method, which returns the `Step` instance it
created.

#### Steps
Expand Down
2 changes: 1 addition & 1 deletion src/js/shepherd.js
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ class Tour extends Evented {
}

this.steps.push(step);
return this;
return step;
}

removeStep(name) {
Expand Down

0 comments on commit 26a6317

Please sign in to comment.