Skip to content
New issue

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

Make Browser second constructor argument, de-emphasize default loop #24

Merged
merged 1 commit into from
Dec 22, 2021

Conversation

clue
Copy link
Owner

@clue clue commented Dec 22, 2021

This changeset simplifies usage by making the Browser the second argument and the LoopInterface the last argument to de-emphasize the default loop. Most consumers of this package are not expected to use either parameter, so this should not affect them. This is a BC break for more advanced use cases that do require either argument.

Together with #22 and #23, this means we can now fully rely on the default loop and no longer need to skip any arguments with null values.

// old
$es = new Clue\React\EventSource\EventSource('https://example.com/stream.php');
$es = new Clue\React\EventSource\EventSource('https://example.com/stream.php', null, $browser);
$es = new Clue\React\EventSource\EventSource('https://example.com/stream.php', $loop, $browser);

// new
$es = new Clue\React\EventSource\EventSource('https://example.com/stream.php');
$es = new Clue\React\EventSource\EventSource('https://example.com/stream.php', $browser);
$es = new Clue\React\EventSource\EventSource('https://example.com/stream.php', $browser, $loop);

Refs #10/#17 to simplify passing a custom Browser object which could potentially hold custom default headers.

Builds on top of #22, #23, #4 and possibly others

@clue clue added new feature New feature or request BC break labels Dec 22, 2021
@clue clue added this to the v1.0.0 milestone Dec 22, 2021
@SimonFrings SimonFrings merged commit 7fc5855 into clue:master Dec 22, 2021
@clue clue deleted the browser-before-loop branch December 22, 2021 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BC break new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants