-
Notifications
You must be signed in to change notification settings - Fork 74
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
Using IxJS with Node #227
Comments
Here's a repo with the project: https://github.com/acchou/ixjs-example |
@acchou to use Ix without transpiling, you need to launch with node's |
The tests are run via |
Thank you, this resolves the issue with How about the DOM library issue? I can issue a PR with some type definitions for |
IxJS version:
v2.3.5
Code to reproduce:
tsconfig.json:
package.json:
src/main.js:
Expected behavior:
This is pretty much the example in the readme, the expected output is:
Actual behavior:
Additional information:
First of all, thanks for building IxJS, it seems like a very powerful and compact library for working with async iterators/generators. The natural way backpressure is handled in this framework seems to make IxJS a good fit for backend programming with Node.js. But there are a few issues I ran into when trying out very simple examples, that might prevent others from getting to know IxJS in a Node.js setup.
There are a few things here:
dom
library to compile. Removing"lib": ["dom"]
from tsconfig.json gives the following errors:This can be addressed by users adding their own
ix.d.ts
with some type definitions to make the compiler happy, but perhaps these could be added to IxJS itself. The types seem harmless to add because TypeScript will do declaration merging with the dom library, and there is a dynamic check infromevent.ts
:Symbol.asyncIterator
isn't defined when using Node, uncommenting the first line allows the example to run correctly:But this isn't mentioned anywhere. In particular, this definition must be before importing IxJS, otherwise the example yields an infinite loop:
Also, out of curiosity I tried to decipher how IxJS's tests run without defining Symbol.asyncIterator somewhere and I couldn't figure it out. It might be helpful to document here for anyone who is curious later.
The text was updated successfully, but these errors were encountered: