Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rxjs interop updates #49769

Closed
wants to merge 4 commits into from
Closed

Rxjs interop updates #49769

wants to merge 4 commits into from

Conversation

atscott
Copy link
Contributor

@atscott atscott commented Apr 10, 2023

See individual commits

@atscott atscott added area: core Issues related to the framework runtime target: major This PR is targeted for the next major release labels Apr 10, 2023
@ngbot ngbot bot modified the milestone: Backlog Apr 10, 2023
@JeanMeche
Copy link
Member

Are these changes too late for the RC ?

Copy link
Contributor

@jessicajaniuk jessicajaniuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: fw-core, public-api

@pullapprove pullapprove bot requested a review from dylhunn April 11, 2023 13:58
@atscott
Copy link
Contributor Author

atscott commented Apr 11, 2023

Are these changes too late for the RC ?

These kinds of changes are exactly the type of thing we should change in the RC period (also RC isn't until tomorrow). Based on feedback during this period, we can and should update features that will go into the final release.

@atscott atscott added target: rc This PR is targeted for the next release-candidate and removed target: major This PR is targeted for the next major release labels Apr 11, 2023
// fromObservable(Observable<Animal>) -> Signal<Cat>
source: Observable<T>, options: {requireSync: true}): Signal<T>;
export function fromObservable<T, U = undefined>(
source: Observable<T>, options?: {initialValue?: U, requireSync?: boolean}): Signal<T|U> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I'd add an explanatory comment that this signature has to be listed second

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't though, does it? The first two can be in either order. Or do you mean the last one has to be listed third?

@pullapprove pullapprove bot requested a review from dylhunn April 11, 2023 21:17
Copy link
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: fw-core, public-api

@atscott atscott force-pushed the rxjsInteropUpdates branch 3 times, most recently from 4a777ae to fd42d6a Compare April 11, 2023 22:57
The initial value used for signals by default is now `undefined`. In
addition, there is a new option to express that the signal should emit a
value synchronously (`requireSync: true`). When this value is specified,
the function will throw _on creation_ if the subscribing to the
`Observable` does not result in a synchronous emit.
Based on feedback in the RFC, most would prefer `toSignal` and
`toObservable`.
From Ben:

> When dealing with any reactive function call you don't control
> like `observer.next()` (or anything similar), you want to catch the error
> in the producer call, in this case `signal()`. You don't want to catch errors
> in the `observer.next` call itself.
`toObservable` creates an `effect` that watches for updates to the
source signal. We should allow writes to signals in this effect, which
would be consumed by downstream observers.
*
* @developerPreview
*/
export interface FromSignalOptions {
export interface toObservableOptions {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pascal

@AndrewKushnir AndrewKushnir added the action: merge The PR is ready for merge by the caretaker label Apr 12, 2023
@AndrewKushnir
Copy link
Contributor

Caretaker note: adding the "merge" label based on the conversation with @atscott.

@AndrewKushnir
Copy link
Contributor

This PR was merged into the repository by commit 1dddb78.

AndrewKushnir pushed a commit that referenced this pull request Apr 12, 2023
#49769)

The initial value used for signals by default is now `undefined`. In
addition, there is a new option to express that the signal should emit a
value synchronously (`requireSync: true`). When this value is specified,
the function will throw _on creation_ if the subscribing to the
`Observable` does not result in a synchronous emit.

PR Close #49769
AndrewKushnir pushed a commit that referenced this pull request Apr 12, 2023
…e] (#49769)

Based on feedback in the RFC, most would prefer `toSignal` and
`toObservable`.

PR Close #49769
AndrewKushnir pushed a commit that referenced this pull request Apr 12, 2023
From Ben:

> When dealing with any reactive function call you don't control
> like `observer.next()` (or anything similar), you want to catch the error
> in the producer call, in this case `signal()`. You don't want to catch errors
> in the `observer.next` call itself.

PR Close #49769
AndrewKushnir pushed a commit that referenced this pull request Apr 12, 2023
…49769)

`toObservable` creates an `effect` that watches for updates to the
source signal. We should allow writes to signals in this effect, which
would be consumed by downstream observers.

PR Close #49769
AndrewKushnir pushed a commit that referenced this pull request Apr 12, 2023
…e] (#49769)

Based on feedback in the RFC, most would prefer `toSignal` and
`toObservable`.

PR Close #49769
AndrewKushnir pushed a commit that referenced this pull request Apr 12, 2023
From Ben:

> When dealing with any reactive function call you don't control
> like `observer.next()` (or anything similar), you want to catch the error
> in the producer call, in this case `signal()`. You don't want to catch errors
> in the `observer.next` call itself.

PR Close #49769
AndrewKushnir pushed a commit that referenced this pull request Apr 12, 2023
…49769)

`toObservable` creates an `effect` that watches for updates to the
source signal. We should allow writes to signals in this effect, which
would be consumed by downstream observers.

PR Close #49769
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants