Skip to content

Commit

Permalink
Introducing new project MrMeeseeks.Reactive which has stuff for Rx
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeah69 committed Sep 15, 2020
1 parent 3caf5ac commit 768ef76
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 26 deletions.
41 changes: 41 additions & 0 deletions Directory.Build.props
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 MrMeeseeks.Reactive/Extensions/INotifyPropertyChangedExtensions.cs
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);
}
}
}
12 changes: 12 additions & 0 deletions MrMeeseeks.Reactive/Extensions/IObservableExtensions.cs
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);
}
}
10 changes: 10 additions & 0 deletions MrMeeseeks.Reactive/Extensions/IObserverExtensions.cs
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);
}
}
19 changes: 19 additions & 0 deletions MrMeeseeks.Reactive/MrMeeseeks.Reactive.csproj
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>
11 changes: 11 additions & 0 deletions MrMeeseeks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MrMeeseeks", "MrMeeseeks\Mr
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MrMeeseeks.Test", "MrMeeseeks.Test\MrMeeseeks.Test.csproj", "{A4FE2B83-F32F-4FE0-87CA-EBCF1D099110}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MrMeeseeks.Reactive", "MrMeeseeks.Reactive\MrMeeseeks.Reactive.csproj", "{B24E41A1-91E5-4CD8-92B2-5F52FF948F4A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Misc", "Misc", "{4DC733E7-47E7-439E-A415-620EB886DBB9}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -21,6 +28,10 @@ Global
{A4FE2B83-F32F-4FE0-87CA-EBCF1D099110}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4FE2B83-F32F-4FE0-87CA-EBCF1D099110}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4FE2B83-F32F-4FE0-87CA-EBCF1D099110}.Release|Any CPU.Build.0 = Release|Any CPU
{B24E41A1-91E5-4CD8-92B2-5F52FF948F4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B24E41A1-91E5-4CD8-92B2-5F52FF948F4A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B24E41A1-91E5-4CD8-92B2-5F52FF948F4A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B24E41A1-91E5-4CD8-92B2-5F52FF948F4A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
26 changes: 0 additions & 26 deletions MrMeeseeks/MrMeeseeks.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>8</LangVersion>
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>69.0.1</PackageVersion>
<Title>MrMeeseeks</Title>
<Authors>Yeah69</Authors>
<PackageIcon>Yeah69Logo_256.png</PackageIcon>
<RepositoryType>git</RepositoryType>
<PackageTags>Utility Helper MrMeeseeks</PackageTags>
<PackageLicenseExpression />
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReleaseNotes>Initial</PackageReleaseNotes>
<Description># MrMeeseeks
This is a project where I'll dump all utility algorithms and data structures 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.
Expand All @@ -22,20 +10,6 @@ If you find something interesting for you, feel free to use at your own risk. I
Existence is pain for Tasks! You are obliged to keep them simple and fast to accomplished! Or otherwise they'll get back at you!

DON'T USE THE BOX ON PRODUCTION CODE! You are warned!</Description>
<PackageProjectUrl>https://github.com/Yeah69/MrMeeseeks</PackageProjectUrl>
<RepositoryUrl>https://github.com/Yeah69/MrMeeseeks</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<None Include="..\Icon\Yeah69Logo.ico" Pack="true" PackagePath="" />
<None Include="..\Icon\Yeah69Logo_256.png" Pack="true" PackagePath="" />
</ItemGroup>

</Project>

0 comments on commit 768ef76

Please sign in to comment.