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

mockServiceWorker: Uses "self" instead of "this" #568

Merged
merged 1 commit into from
Jan 26, 2021

Conversation

kettanaito
Copy link
Member

Per @timdeschryver suggestion, it's better if we consistently used self in the worker file instead of context-dependant this.

  • self always refers to a global Service Worker scope.
  • this is context-dependant and may change have we re-assigned a parent function's context, for example.

@kettanaito kettanaito added BREAKING CHANGE Pull request introducing breaking changes. chore Tasks aimed at internal improvement labels Jan 26, 2021
Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit eebd0b3:

Sandbox Source
MSW React Configuration

@kettanaito kettanaito merged commit a7b4d3f into master Jan 26, 2021
@kettanaito kettanaito deleted the refactor/worker-self branch January 26, 2021 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE Pull request introducing breaking changes. chore Tasks aimed at internal improvement release candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants