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

Fix babel build error, convert Poll class into a function #1594

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JSReds
Copy link
Contributor

@JSReds JSReds commented May 25, 2022

Change-type: patch
Signed-off-by: Andrea Rosci [email protected]

This PR should resolve a babel build error:

ERROR in ./src/utils/poll.ts 42:16
Module parse failed: The keyword 'private' is reserved (42:16)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| var DEFAULT_GRACE_RATIO = 0.33;
| export var Poll = /*#__PURE__*/function () {
>   function Poll(private fn, private interval, graceRatio, isTabActive) {
|     _classCallCheck(this, Poll);
|
 @ ./src/index.ts 58:0-48 58:0-48 58:0-48
 @ ./.storybook/preview.js
 @ ./.storybook/preview.js-generated-config-entry.js
 @ multi ./node_modules/@storybook/core-client/dist/esm/globals/polyfills.js ./node_modules/@storybook/core-client/dist/esm/globals/globals.js ./.storybook/storybook-init-framework-entry.js ./node_modules/@storybook/addon-essentials/node_modules/@storybook/addon-docs/dist/esm/frameworks/common/config.js-generated-other-entry.js ./node_modules/@storybook/addon-essentials/node_modules/@storybook/addon-docs/dist/esm/frameworks/react/config.js-generated-other-entry.js ./node_modules/@storybook/addon-links/dist/esm/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/esm/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-actions/dist/esm/preset/addArgs.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/esm/preset/addDecorator.js-generated-other-entry.js ./node_modules/@storybook/addon-backgrounds/dist/esm/preset/addParameter.js-generated-other-entry.js ./node_modules/@storybook/addon-measure/dist/esm/preset/preview.js-generated-other-entry.js ./node_modules/storybook-addon-outline/dist/esm/preset/addDecorator.js-generated-other-entry.js ./.storybook/preview.js-generated-config-entry.js ./.storybook/generated-stories-entry.js (webpack)-hot-middleware/client.js?reload=true&quiet=false&noInfo=undefined

Contributor checklist
  • I have regenerated jest snapshots for any affected components with npm run generate-snapshots
Reviewer Guidelines
  • When submitting a review, please pick:
    • 'Approve' if this change would be acceptable in the codebase (even if there are minor or cosmetic tweaks that could be improved).
    • 'Request Changes' if this change would not be acceptable in our codebase (e.g. bugs, changes that will make development harder in future, security/performance issues, etc).
    • 'Comment' if you don't feel you have enough information to decide either way (e.g. if you have major questions, or you don't understand the context of the change sufficiently to fully review yourself, but want to make a comment)

src/utils/poll.ts Outdated Show resolved Hide resolved

export const createPoll = (
fn: (poll: Poll) => Promise<any>,
fn: () => Promise<any>,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we do use this in the UI to check whether the poll is cancelled.
Or maybe we only do that for useRequest 🤔 ?

src/utils/poll.ts Outdated Show resolved Hide resolved
@JSReds JSReds marked this pull request as draft May 25, 2022 21:39
Change-type: patch
Signed-off-by: Andrea Rosci <[email protected]>
@JSReds
Copy link
Contributor Author

JSReds commented May 27, 2022

need discussion, the fix was released with #1595

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants