Rxjs: fromPromise no longer exported in master (v6), the replacement from creation function is too heavy weight

Created on 2 Mar 2018  Â·  4Comments  Â·  Source: ReactiveX/rxjs

RxJS version:
6.0.0-alpha.3

Code to reproduce:

import { fromPromise } from 'rxjs';

Expected behavior:
should work just as it did with v5.5 (but different location)

Actual behavior:
no longer exported, the only alternative is from but that operator is significantly more heavier because it supports all kinds of imports. I suggest that you export just the specific fromXXX creation methods and don't export from because it's too big.

Alternatively export both individual fromXXX functions as well as from but then you need to document that client side developers should not use from, which makes things very confusing. It's always better to have just one way to do a thing - and it should be the right way.

Additional information:

Most helpful comment

just use from instead of fromPromise.

import { from } from 'rxjs';

All 4 comments

So you're aware, using mergeMap, switchMap, concatMap, etc, will pull in most of the logic from from as well. So I'm not sure this is a big win for 95% of apps.

ok. sounds like splitting up this is not worth it. we should just be
consistent and intentional about which fromXXX operators we expose. I
suggest that we just alias fromPromise to from in the compat library
and remove it from rxjs proper. Having two operators that accept the same
input and return the same output is confusing. There should be just one.
Your call.

On Mon, Mar 5, 2018 at 3:58 PM Ben Lesh notifications@github.com wrote:

So you're aware, using mergeMap, switchMap, concatMap, etc, will pull in
most of the logic from from as well. So I'm not sure this is a big win
for 95% of apps.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/ReactiveX/rxjs/issues/3374#issuecomment-370611088,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AANM6JeIf-5JfZseCslnBDpBPwivLisJks5tbdE7gaJpZM4SaeF0
.

It looks like this did not make the cut for the 6.0 release.

Should we use import { fromPromise } from 'rxjs/internal/observable/fromPromise'; for now?

just use from instead of fromPromise.

import { from } from 'rxjs';
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Agraphie picture Agraphie  Â·  3Comments

benlesh picture benlesh  Â·  3Comments

peterbakonyi05 picture peterbakonyi05  Â·  4Comments

shenlin192 picture shenlin192  Â·  3Comments

LittleFox94 picture LittleFox94  Â·  3Comments