• Stars
    star
    240
  • Rank 168,229 (Top 4 %)
  • Language
    C#
  • License
    MIT License
  • Created over 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Builds observables from events.

Build Code Coverage

Pharmacist

Builds observables from events.

Source Generator

A source generator version is being worked on over here: https://github.com/reactivemarbles/ObservableEventsSourceGenerator

NuGet Packages

Install the following packages to start using Pharmacist.

Name Platform NuGet
Pharmacist.Core Core - Libary CoreBadge
Pharmacist Global Tool GlobalToolBadge
Pharmacist.MSBuild MSBuild Task MsBuildBadge
Pharmacist.Common Common CommonBadge

What does it do?

Pharmacist will convert events within an assembly and create observable wrappers for them.

It has been called pharmacist since it will generate Reactive Extensions (Rx) Observables for events, so it's a play on word about "Rx" which is short for prescriptions.

It can generate the observables for the following:

  • System Platforms, such as Xamarin (iOS/Android/TVOS), UWP
  • NuGet packages
  • Assemblies.

There is a MSBuild Task version and a global tool version.

How do I use?

MsBuild

Pharmacist can automatically create Observable wrappers for projects for their explicitly included NuGet packages.

In your .csproj file you can add:

<ItemGroup>
    <PackageReference Include="Pharmacist.MsBuild" Version="1.*" PrivateAssets="all" />
    <PackageReference Include="Pharmacist.Common" Version="1.*" />
</ItemGroup>

Pharmacist.MsBuild contains the MsBuild target file and appropriate tasks. Pharmacist.Common includes common source code that is required to invoke the generated observables.

This will generate wrappers only for other included PackageReference's contained within the project file.

For example if you had a inclusion for Xamarin.Forms in the same project that includes Pharmacist it will generate Observable wrappers for the included codes. It will not include any child PackageReference from other projects included via a ProjectReference. You can override that functionality by including <PharmacistGlobalPackages>true</PharmacistGlobalPackages> in a PropertyGroup inside your project.

Also it will only generate the specified ProjectReference and none of it's dependent packages. For example for a ProjectReference inclusion of ReactiveUI, it will not generate dependencies such as System.Reactive. If you want to generate observable wrappers for the dependent NuGet packages you must explicitly include them.

Command Line

Pharmacist comes with a command line version which is useful for generating for a specified platform.

The following values are supported for platforms: Android, iOS, Mac, WPF, UWP, Winforms, TVOS

Install the global tool:

dotnet tool install -g Pharmacist

To generate files:

pharmacist generate-platform -p <Platform> -o c:/directory/for/output --output-prefix="Events"

This would generate a file named Events_<Platform>.cs, where Platform would be the platform specified.

In the near future this will be changing to TargetFramework with /wpf and /winforms options.

Contribute

Pharmacist is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use. Because of our Open Collective model for funding and transparency, we are able to funnel support and funds through to our contributors and community. We ❀ the people who are involved in this project, and we’d love to have you on board, especially if you are just getting started or have never contributed to open-source before.

So here's to you, lovely person who wants to join us β€” this is how you can support us:

More Repositories

1

refit

The automatic type-safe REST library for .NET Core, Xamarin and .NET. Heavily inspired by Square's Retrofit library, Refit turns your REST API into a live interface.
C#
8,590
star
2

ReactiveUI

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming. ReactiveUI allows you to abstract mutable state away from your user interfaces, express the idea around a feature in one readable place and improve the testability of your application.
C#
8,080
star
3

Akavache

An asynchronous, persistent key-value store created for writing desktop and mobile applications, based on SQLite3. Akavache is great for both storing important data as well as cached local data that expires.
C#
2,448
star
4

splat

Makes things cross-platform
C#
972
star
5

Camelotia

Cross-platform sample .NET GUI for cloud file management.
C#
556
star
6

ReactiveUI.Samples

This repository contains ReactiveUI samples.
C#
329
star
7

Fusillade

An opinionated HTTP library for Mobile Development
C#
310
star
8

punchclock

Make sure your asynchronous operations show up to work on time
C#
261
star
9

ReactiveUI.Validation

Validation helpers for ReactiveUI-based apps.
C#
238
star
10

ReactiveMvvm

Cross-platform ReactiveUI sample app built for a talk at MSK .NET conf.
C#
180
star
11

Sextant

A ReactiveUI navigation library for Xamarin.Forms
C#
157
star
12

website

ReactiveUI documentation and guidelines website. PR's welcome! πŸ’–
C#
35
star
13

Splat.DI.SourceGenerator

C#
30
star
14

ReactiveUI.SourceGenerators

Use source generators to generate objects.
C#
27
star
15

Reactive.Wasm

A Web Assembly versions of the System.Reactive classes.
C#
13
star
16

ReactiveObject.Generators

C#
8
star
17

rfcs

RFCs for changes to ReactiveUI
Shell
5
star
18

styleguide

design / marketing style guide for ReactiveUI
HTML
4
star
19

Maui.Plugins.Popup

ReactiveUI support for Maui Popups
C#
4
star
20

.github

2
star
21

actions-common

Common GitHub actions for the ReactiveUI project
2
star
22

ReactiveUI.Uno

C#
1
star