{"id":18780296,"url":"https://github.com/reactivemarbles/observableevents","last_synced_at":"2025-05-16T04:05:01.570Z","repository":{"id":38108947,"uuid":"297284375","full_name":"reactivemarbles/ObservableEvents","owner":"reactivemarbles","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-15T20:03:30.000Z","size":338,"stargazers_count":132,"open_issues_count":27,"forks_count":12,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-16T04:04:55.994Z","etag":null,"topics":["csharp","dotnet"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reactivemarbles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"reactivemarbles"}},"created_at":"2020-09-21T08:59:54.000Z","updated_at":"2025-05-10T05:48:07.000Z","dependencies_parsed_at":"2024-02-17T06:30:46.202Z","dependency_job_id":"f5839be4-6387-4b52-ba66-6f5f7145d3a3","html_url":"https://github.com/reactivemarbles/ObservableEvents","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactivemarbles%2FObservableEvents","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactivemarbles%2FObservableEvents/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactivemarbles%2FObservableEvents/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reactivemarbles%2FObservableEvents/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reactivemarbles","download_url":"https://codeload.github.com/reactivemarbles/ObservableEvents/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254464895,"owners_count":22075570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet"],"created_at":"2024-11-07T20:25:40.377Z","updated_at":"2025-05-16T04:04:56.556Z","avatar_url":"https://github.com/reactivemarbles.png","language":"C#","funding_links":["https://github.com/sponsors/reactivemarbles"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://github.com/reactivemarbles/observableevents\"\u003e\n    \u003cimg width=\"150\" src=\"./images/logo.png\"/\u003e\n\u003c/a\u003e\n\n# Observable Event Generator\n\nThis project is a .NET source generator which produces `IObservable\u003cT\u003e` for events contained within a object including all base classes. `ObservableEvents` generator will convert events within an assembly and create observable wrappers for them, it is based on [Pharmacist](https://github.com/reactiveui/Pharmacist) and uses [.NET Source Generator](https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/source-generators-overview) technology.\n\n## NuGet Packages\n\nMake sure your project is using the newer `PackageReference` inside your CSPROJ. The older style is buggy and should be moved away from regardless. See here for discussions how to [upgrade](https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference).\n\nInstall the following packages to start using Observable Events.\n\n| Name                          | Platform          | NuGet                            |\n| ----------------------------- | ----------------- | -------------------------------- |\n| [ReactiveMarbles.ObservableEvents.SourceGenerator][Core]       | Core - Libary     | [![CoreBadge]][Core]             |\n\n[Core]: https://www.nuget.org/packages/ReactiveMarbles.ObservableEvents.SourceGenerator/\n[CoreBadge]: https://img.shields.io/nuget/v/ReactiveMarbles.ObservableEvents.SourceGenerator.svg\n\n## Manual Installation\n\nInclude the following in your .csproj file\n\n```xml\n\u003cPackageReference\n    Include=\"ReactiveMarbles.ObservableEvents.SourceGenerator\"\n    Version=\"1.0.2\"\n    PrivateAssets=\"all\" /\u003e\n```\n\nThe `PrivateAssets` will prevent the ObservableEvents source generator from being inherited by other projects.\n\n## How to use\n\n### Instance Based\n\nIt injects a class for instance based events into your source code which will expose a extension method called `Events()`. You need to include the namespace `ReactiveMarbles.ObservableEvents` to access to the extension method. You can then use this to get `IObservable\u003cT\u003e` instances from your events.\n\n```cs\nusing ReactiveMarbles.ObservableEvents;\n\npublic void MyClass : INotifyPropertyChanged\n{\n  // Assumes this belong in a class with a event called PropertyChanged.\n  public void RunEvents()\n  {\n      this.Events().PropertyChanged.Subscribe(x =\u003e Console.WriteLine($\"The {x} property has changed\"));\n  }\n\n  public event PropertyChangedEventHandler PropertyChanged;\n}\n```\n\n### Static Events\n\nYou must use include a attribute `GenerateStaticEventObservables` on the assembly level for a particular class. This will generate a class `RxEvents` in the same namespace as the specified class.\n\n```cs\n[assembly: GenerateStaticEventObservablesAttribute(typeof(StaticTest))]\npublic static class StaticTest\n{\n    public static event EventHandler? TestChanged;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactivemarbles%2Fobservableevents","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactivemarbles%2Fobservableevents","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactivemarbles%2Fobservableevents/lists"}