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

Removed the Avalonia.ReactiveUI dependency #118

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

CrackAndDie
Copy link
Contributor

@CrackAndDie CrackAndDie commented Feb 12, 2024

Vanilla Prism doesn't have dependencies on libraries like the ReactiveUI (libraries that help us to create UI with code weaving). So I think that Prism.Avalonia also should not use it.
The only thing used in ReactiveUI was subscribing on IObservable interface implementations with lambda methods. In my opinion this is innormal to depend on the library and use only a thing.
So now there is a AnonymousObserver implementation taken from ReactiveUI and ObservableExtensions that gives us the Subscribe method for IObservables.
Tests added :)

Removed the dependency and replaced some stuff with internal code
@DamianSuess
Copy link
Collaborator

DamianSuess commented Feb 13, 2024

For this PR, may you update the description of this PR to explain, "added some required implementations", and include a unit test for the functionality to ensure we are getting the expected behaviors.

This assists future readers of this PR to understand what was changed and how it affects the library.

@CrackAndDie
Copy link
Contributor Author

Just updated the description of the RP

…servableExtensions is internal now and visible only for Tests
@Mrxx99
Copy link

Mrxx99 commented Mar 9, 2024

You can also look at https://github.com/devlooped/RxFree which are source only reactive extensions with the basic feature of System.Reactive, so you don't have to reimplement the helpers. The extensions also will be internal to your project so consumers won't see them.

@CrackAndDie
Copy link
Contributor Author

CrackAndDie commented Mar 9, 2024

@Mrxx99 I've added implemention only for the Subscribe extension method for IObservable. AnonymousObserver (IObserver implementation) was removed in the third commit of mine because it is already in Avalonia.Base. I don't see any dependencies on System.Reactive 🤔

@DamianSuess
Copy link
Collaborator

This will be merged in shortly. Sorry for the delay, had to tend to other repos over the past couple weeks

@DamianSuess DamianSuess added the enhancement New feature or request label Apr 8, 2024
@DamianSuess DamianSuess added this to the Avalonia v11.0 milestone Apr 8, 2024
@DamianSuess DamianSuess self-assigned this Apr 8, 2024
@DamianSuess DamianSuess merged commit 1a43a5f into AvaloniaCommunity:develop Apr 8, 2024
@DamianSuess DamianSuess self-requested a review April 8, 2024 22:42
@DamianSuess
Copy link
Collaborator

All set

@DamianSuess DamianSuess linked an issue Apr 8, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Issue] Dependency on Avalonia.ReactiveUI
3 participants