Replies: 3 comments 1 reply
-
I just want to point out that option 1 is 100% compatible and aligned with what it was proposed on #7250 . In fact, if that proposal were to succeed, then the implementation of const intercept = <T>(
prev: Observer<T>,
next: Partial<Omit<Observer<T>, 'owner'>>
): Partial<Observer<T>> => ({
...next,
owner: prev.owner,
}) |
Beta Was this translation helpful? Give feedback.
1 reply
-
My two cents:
export function chain<T>(destination: Subscriber<any>, on: Partial<Observer<T>> & { finalize?: () => void }): Subscriber<T> {
return new OperatorSubscriber(destination, on.next, on.complete, on.error, on.finalize);
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
At this point, I've settled on the following: export function myMap<In, Out>(project: (value: In) => Out): OperatorFunction<In, Out> {
return (source) => new Observable(destination => {
source.subscribe(operate({
destination,
next: value => destination.next(project(value))
}));
})
} Will land a PR around this soon. |
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
-
Goals
Proposal
Productize our
createOperatorSubscriber
function such that it is easier to read and understand. This work would include:intercept
?,chain
?,hook
?override
?operate
?).Subscriber
.Something like this:
createOperatorSubscriber
, only with a different name and named params:or...
Subscriber
that does this work:EDIT: After some experimentation and some thought, I'm now leaning towards option 1 above. The reasoning:
Beta Was this translation helpful? Give feedback.
All reactions