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

Usage in web-components environment #186

Open
K4CZP3R opened this issue Oct 14, 2022 · 0 comments
Open

Usage in web-components environment #186

K4CZP3R opened this issue Oct 14, 2022 · 0 comments

Comments

@K4CZP3R
Copy link

K4CZP3R commented Oct 14, 2022

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Current behavior

I'm trying to make it work with lit (web components).
I made one change in the source code to make it compile:

in index.js I've changed

return new PCancelable__default((resolve, reject) => {

to

return new Promise((resolve, reject) => {

Without it I will get

PCancelable__default is not a constructor

Expected behavior

I would love to know if there is any specific reason to not use Promise in this case. Because with the promise, it is possible to make it work with lit.

Minimal reproduction of the problem with instructions

  • Clone lit boilerplate
  • Replace package.json content with the content from package.txt
  • Replace home-element.ts content with the content from home-element.txt
  • Replace PCancelable__default in node_modules/reaflow/dist/index.js with Promise

What is the motivation / use case for changing the behavior?

I would love to use this library in my web component project, there are no good enough alternatives to this lib.

Environment


Libs:
- react-dom version: 18.2.0
- reaflow version: 5.0.7


Browser:
- [x] Chrome (desktop) version 106
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX

For Tooling issues:
- Node version: XX  
- Platform:  

Others:

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

No branches or pull requests

1 participant