-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introducing new project MrMeeseeks.Reactive which has stuff for Rx
- Loading branch information
Showing
7 changed files
with
117 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.0</TargetFramework> | ||
<PackageVersion>69.0.3</PackageVersion> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<DisableTransitiveProjectReferences>true</DisableTransitiveProjectReferences> | ||
<LangVersion>8</LangVersion> | ||
<Nullable>enable</Nullable> | ||
<WarningsAsErrors>nullable</WarningsAsErrors> | ||
<Authors>Yeah69</Authors> | ||
<PackageIcon>Yeah69Logo_256.png</PackageIcon> | ||
<RepositoryType>git</RepositoryType> | ||
<PackageTags>Utility Helper MrMeeseeks</PackageTags> | ||
<Version>69.0.3</Version> | ||
<AssemblyVersion>69.0.3.0</AssemblyVersion> | ||
<FileVersion>69.0.3.0</FileVersion> | ||
<PackageProjectUrl>https://github.com/Yeah69/MrMeeseeks</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/Yeah69/MrMeeseeks</RepositoryUrl> | ||
<PackageLicenseExpression /> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> | ||
<PackageReleaseNotes>-/-</PackageReleaseNotes> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\LICENSE"> | ||
<Pack>True</Pack> | ||
<PackagePath/> | ||
</None> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\Icon\Yeah69Logo.ico"> | ||
<Pack>true</Pack> | ||
<PackagePath/> | ||
</None> | ||
<None Include="..\Icon\Yeah69Logo_256.png"> | ||
<Pack>true</Pack> | ||
<PackagePath/> | ||
</None> | ||
</ItemGroup> | ||
</Project> |
24 changes: 24 additions & 0 deletions
24
MrMeeseeks.Reactive/Extensions/INotifyPropertyChangedExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using System.Reactive.Linq; | ||
using MoreLinq; | ||
using MrMeeseeks.Extensions; | ||
|
||
namespace MrMeeseeks.Reactive.Extensions | ||
{ | ||
public static class INotifyPropertyChangedExtensions | ||
{ | ||
public static IObservable<string> ObserveProperty( | ||
this INotifyPropertyChanged notifyPropertyChanged, | ||
params string[] propertyNames) | ||
{ | ||
var propertyNamesHashSet = propertyNames.WhereNotNull().ToHashSet(); | ||
return Observable | ||
.FromEventPattern<PropertyChangedEventArgs>( | ||
notifyPropertyChanged, | ||
nameof(notifyPropertyChanged.PropertyChanged)) | ||
.Where(e => propertyNamesHashSet.Contains(e.EventArgs.PropertyName)) | ||
.Select(e => e.EventArgs.PropertyName); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Reactive; | ||
using System.Reactive.Linq; | ||
|
||
namespace MrMeeseeks.Reactive.Extensions | ||
{ | ||
public static class IObservableExtensions | ||
{ | ||
public static IObservable<Unit> SelectUnit<T>(this IObservable<T> observable) => | ||
observable.Select(_ => Unit.Default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System; | ||
using System.Reactive; | ||
|
||
namespace MrMeeseeks.Reactive.Extensions | ||
{ | ||
public static class IObserverExtensions | ||
{ | ||
public static void OnNextUnit(this IObserver<Unit> observer) => observer.OnNext(Unit.Default); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Title>MrMeeseeks.Reactive</Title> | ||
<Description># MrMeeseeks Reactive | ||
This is a project where I'll dump all utility algorithms and data structures for Rx in order to not bloat application-specific code with application-unspecific code and in order to prevent writing same code over and over again. | ||
If you find something interesting for you, feel free to use at your own risk. I don't think that I'll write exhaustive unit test for this project. But feel free to write issues.</Description> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="morelinq" Version="3.3.2" /> | ||
<PackageReference Include="System.Reactive" Version="4.4.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\MrMeeseeks\MrMeeseeks.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters