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

refactor: DRY with context building and *Impl functions #3656

Closed
wants to merge 1 commit into from
Closed

Conversation

yaacovCR
Copy link
Contributor

@yaacovCR yaacovCR commented Jun 21, 2022

The execute/executeImpl and createSourceEventStream/createSourceEventStreamImpl functions follow the same basic pattern of building the context and using it to run a function. This PR extracts that pattern into a separate function.

For good measure, the same pattern in applied to the soon-to-be-deprecated subscribe function.

Heavier refactoring is on the way from @IvanGoncharov (see #3639 (review)), but in the meantime, this consolidates the common pattern without any breaking changes.

@netlify
Copy link

netlify bot commented Jun 21, 2022

Deploy Preview for compassionate-pike-271cb3 ready!

Name Link
🔨 Latest commit 17ffea7
🔍 Latest deploy log https://app.netlify.com/sites/compassionate-pike-271cb3/deploys/62b362b10f50d9000895d42a
😎 Deploy Preview https://deploy-preview-3656--compassionate-pike-271cb3.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋

Supported commands

Please post this commands in separate comments and only one per comment:

  • @github-actions run-benchmark - Run benchmark comparing base and merge commits for this PR
  • @github-actions publish-pr-on-npm - Build package from this PR and publish it on NPM

@yaacovCR yaacovCR requested a review from a team June 21, 2022 20:41
@yaacovCR yaacovCR added the PR: polish 💅 PR doesn't change public API or any observed behaviour label Jun 21, 2022
The `execute`/`executeImpl` and `createSourceEventStream`/`createSourceEventStreamImpl` functions follow the same basic pattern of building the contet and using it to run a function. This PR extracts that pattern into a separate function.

For good measure, the same pattern in applied to the soon-to-be-deprecated `subscribe` function.

Hheavier refactoring is on the way from @IvanGoncharov (see #3639 (review)), but in the meantime, this consolidates the common pattern without any breaking changes.
@yaacovCR
Copy link
Contributor Author

I am folding this into #3644 as a separate commit.

@yaacovCR yaacovCR closed this Jun 23, 2022
@saihaj saihaj deleted the dry branch June 23, 2022 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: polish 💅 PR doesn't change public API or any observed behaviour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants