rxjs icon indicating copy to clipboard operation
rxjs copied to clipboard

'do' operator not usable in es7 bind syntax

Open danikenan opened this issue 9 years ago • 3 comments

RxJS version: 5

Code to reproduce:

import {do as safeDo} from 'rxjs/operator/do'

Expected behavior: $obs::safeDo(a => console.log(a)

Actual behavior: safeDo is undefined

Additional information:

The usage of the reserved word do is the root of all evil, thus we cannot write: import {do} from 'rxjs/operator/do' but rather need to alias it.

Right after this comes the decision to export it as a member and not as default (which would allow client code to import under any name and bypass the issue e.g. import safeDo from 'rxjs/operator/do'

While the code I use, compiles (webpack2, babel) and should have allowed to overcome the issue import {do as safeDo} from 'rxjs/operator/do'

It doesn't, since safeDo is undefined.

By the same token, your usage of import {x} from 'rxjs/operator/x also breaks babel plugins like lodash plugins the would allow us to use the shorter code improt {a, b, c, d} from rxjs/operator and still remain with a small code footprint.

danikenan avatar Mar 02 '17 06:03 danikenan

I think this is dupe of https://github.com/ReactiveX/rxjs/issues/1958 ?

kwonoj avatar Mar 02 '17 06:03 kwonoj

dup of #1958

danikenan avatar Mar 02 '17 06:03 danikenan

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Jun 06 '18 17:06 lock[bot]