Skip to content

Commit

Permalink
[6.x] Add Browser::elsewhereWhenAvailable(). (#846)
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone authored Dec 20, 2020
1 parent 68d0c88 commit 7a6a9e8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,20 @@ public function elsewhere($selector, Closure $callback)
return $this;
}

/**
* Execute a Closure outside of the current browser scope when the selector is available.
*
* @param string $selector
* @param \Closure $callback
* @return $this
*/
public function elsewhereWhenAvailable($selector, Closure $callback)
{
return $this->elsewhere('', function ($browser) use ($selector, $callback) {
$this->whenAvailable($selector, $callback);
});
}

/**
* Set the current component state.
*
Expand Down

0 comments on commit 7a6a9e8

Please sign in to comment.