kosich / rxjs-proxify

Turns a Stream of Objects into an Object of Streams
MIT License
35 stars 3 forks source link

pipe in boolean property causes errors #11

Closed BibbyChung closed 3 years ago

BibbyChung commented 3 years ago

hi there,

i can't use pipe method in boolean property. i try to fix it, but for me it's too difficult. please fix this. thanks ^^

const state = proxify(new BehaviorSubject<{ a: number, b: string, c: boolean }>({ a: 0, b: '999', c: true }));
state.a.pipe(map(a => a));
state.b.pipe(map(a => a));

state.c.pipe(map(a => a));

image

kosich commented 3 years ago

Hey! Thanks for reporting this!

Looks quite weird. Alas, I don't have a solution atm. Will investigate and ping back

kosich commented 3 years ago

Heya!

Seems like TS split boolean intro true | false, so that we got Proxy<true> | Proxy<false>. This merged .pipe overloads and eliminated all but no args version .pipe() — therefore the TS complaint in your screenshot. It happened when we conditioned between callable and non-callable ObservableProxy, though I don't fully understand the underlying TS processes.

Fixed in 0.1.1

npm i rxjs-proxify@latest

Cheers! 🙂

BibbyChung commented 3 years ago

it works. thanks ^^