Skip to content

Commit

Permalink
fixes on onStepIn and onStepOut hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
vildanbina committed Aug 4, 2024
1 parent f5c8652 commit 4af3d21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ use Vildanbina\LivewireWizard\Components\Step;

class General extends Step
{
public function onStepIn($name, $value)
public function onStepIn($newStep)
{
// Something you want
}

public function onStepOut($name, $value)
public function onStepOut($oldStep)
{
// Something you want
}
Expand Down
4 changes: 2 additions & 2 deletions src/Concerns/HasSteps.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ public function setStep($step): void
$this->stepsValidation($this->prevStep($step));
}

$this->getCurrentStep()->callHook('onStepOut');
$this->getCurrentStep()->callHook('onStepOut', $this->activeStep);

$this->activeStep = $step;

$this->getCurrentStep()->callHook('onStepIn');
$this->getCurrentStep()->callHook('onStepIn', $step);

$this->callHook('afterSetStep', $this->activeStep, $step);
}
Expand Down

0 comments on commit 4af3d21

Please sign in to comment.