ReactiveX / IxJS

The Interactive Extensions for JavaScript
https://reactivex.io/IxJS/
MIT License
1.32k stars 73 forks source link

docs(docs/asynciterable/converting.md): Fix fromEventPattern import #350

Closed michaelsbradleyjr closed 1 year ago

michaelsbradleyjr commented 1 year ago

NOTE: There's a subtle problem that I did not attempt to address in this PR related to module resolution. I've been away from the JS/Node ecosystem for a couple of years (though I'm a longtime fan of Ix!) and in order to run .js code (via Node in a terminal) copied from the docs pertaining to this PR, I found I needed to change e.g.

import { fromEventPattern } from 'ix/asynciterable';

to

import { fromEventPattern } from 'ix/asynciterable/index.js';

And I needed to add "type": "module" to package.json relative to the scripts I've been using for experimentation.

Alternatively, after adding "type": "module" to package.json, I could run my scripts by supplying the --experimental-specifier-resolution=node option in my terminal, i.e. without changing the import statement copied from Ix's docs.

Anyway, just a heads up.

michaelsbradleyjr commented 1 year ago

I just realized my notes in the PR description are related to #342, but this PR itself is unrelated, i.e. this PR is only about fixing an import statement in the docs.