-
Notifications
You must be signed in to change notification settings - Fork 72
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
Lettable operator examples are wrong #212
Comments
I had a quick look through and to explain what's happening with your points respectively:
Does that make sense? It's not ideal having these names clash. I'll make a pull request to the docs updating the above points and see if anyone has an opinion about a different way to get access to the lettable functions. Maybe a directory called |
Bit more info from doing this:
whereas |
@desnor That makes sense to me! |
Update (map, filter) example pipe usage to specify path for expected modules, in both ES & CommonJS example lines. Previously it was incorrectly importing the pipe module itself rather than the pipe subdirectory index.js. Update example usage of `of` to be called on the Iterable object. Previously it was not defined before being called. closes issue ReactiveX#212
Or better yet, why not match RxJS's import style? I would assume most users of IxJS would be RxJS folks not wanting to learn another transducer library. Is that assumption correct? If so, wouldn't Also, I noticed this example was wrong as well: // ES
import { AsyncIterableX as AsyncIterable } from 'ix/asynciterable';
import { filter, map } from 'ix/asynciterable/pipe';
// CommonJS
const AsyncIterable = require('ix/asynciterable').AsyncIterableX;
const { filter, map } = require('ix/asynciterable/pipe');
const source = async function* () {
yield 1;
yield 2;
yield 3;
yield 4;
};
const results = from(source()).pipe(
filter(async x => x % 2 === 0),
map(async x => x * x)
);
for await (let item of results) {
console.log(`Next: ${item}`);
} In this example, In RxJS, you can use Either way, having a separate iterator method would help with tree-shaking and ensure more similarities to RxJS. |
Update (map, filter) example pipe usage to specify path for expected modules, in both ES & CommonJS example lines. Previously it was incorrectly importing the pipe module itself rather than the pipe subdirectory index.js. Update example usage of `of` to be called on the Iterable object. Previously it was not defined before being called. closes issue #212
IxJS version: 2.3.4
Code to reproduce:
The
README
has the following example on how to use lettable operators:A few issues here:
of
come from?import { map, filter } from 'ix/iterable/pipe';
does not seem to work. Rather one has to doimport { map } from 'ix/iterable/pipe/map';
etc.The text was updated successfully, but these errors were encountered: