subscribe object propertiesas rxjs operators #6521
Judimax
started this conversation in
Ideas / Feature request
Replies: 2 comments 2 replies
-
Do you have any example? It's a bit hard to picture without one |
Beta Was this translation helpful? Give feedback.
2 replies
-
// @ts-nocheck
import {of} from 'rxjs';
import {next,error,complete,subscribe} from 'rxjs/operators';
of({})
.pipe(
timeout(2500),
concatMap(() => of(1)),
exhaust(),
next(()=>{}),
error(()=>{}),
complete(()=>{}),
)
.subscribe()
ajax("www.google.com")
.pipe(
concatMap(() => of(1)),
exhaust(),
next(()=>{}),
error(()=>{}),
complete(()=>{}),
)
.subscribe()
defer(()=>{return from(myPromise)})
.pipe(
concatMap(() => of(1)),
mergeMap(() => of(1)),
error(()=>{}),
)
.subscribe()
http.post(
endpoint,
{large JSON body},
{many headers and params}
)
.pipe(
takeUntil(()=>{return true}),
complete(()=>{}),
)
.subscribe() would be neater than how we would regularly treat the Observer object properties |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Greetings to all
everyone familar with the Observer properties (next,complete,error)
wouldn't it be nice to have them as rxjs operators, it would make our code look much cleaner
Beta Was this translation helpful? Give feedback.
All reactions