Broadcaster.PubSub.Framework 1.0.1

dotnet add package Broadcaster.PubSub.Framework --version 1.0.1                
NuGet\Install-Package Broadcaster.PubSub.Framework -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Broadcaster.PubSub.Framework" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Broadcaster.PubSub.Framework --version 1.0.1                
#r "nuget: Broadcaster.PubSub.Framework, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Broadcaster.PubSub.Framework as a Cake Addin
#addin nuget:?package=Broadcaster.PubSub.Framework&version=1.0.1

// Install Broadcaster.PubSub.Framework as a Cake Tool
#tool nuget:?package=Broadcaster.PubSub.Framework&version=1.0.1                

Broadcaster

A lightweight, simple, and efficient system to replace clunky, memory-leak inducing, typical event subscriptions in .NET Standard.

Typcial event subscriptions like this:

SomeObservableCollection.CollectionChanged += (s,e) => Ahandler();

...will always result in a memory leak. This forces the conscientious developer to create a method like this:

SomeObservableCollection.CollectionChanged += OnCollectionChanged;
...
private void OnCollectionChanged(object sender, CollectionChangedEventArgs a) 
{
... do some stuff ...
}

And then when the subscription is no longer desired:

SomeObservableCollection.CollectionChanged -= OnCollectionChanged;

If used correctly, this will never create a memory leak (emphasis on 'if'). This mechanism is clunky, wordy, and obtuse.

UI still and probably will always require true events (marked with the event keyword) to latch onto, but for the rest of the business code, I think we'd all prefer something a bit...cleaner and easier to use. See the wiki for an example.

Broadcaster provides a frameworkd for easily listening for, handling, and unsubscribing from events that allows the use of lambdas (!!).
It's a thing of beauty to use in a large application (which I have) and once this easy to use system is understood, it is simple to unsubscribe to any and all events. If you are familiar with the Reactive framework, then this will be right up your alley.

The syntax is similar to subscribing to a Reactive event, but less wordy and obtuse, but it does follow the same disposable token methodology (because that is far and above the best way to subscribe/unsubscribe from events).

If you are already using the Reactive framework, just use their event pattern. This is a lightweight framework that just focuses on simple event subscription/unsubscription and nothing else.

If you're using the EventAggregator or some other PubSub mechanism, this may be a better alternative b/c it is strongly typed when it can be, but allows loose typing with enums, too. And it awaits all handlers! Can be used in a global scope, or a local scope.

Show me some ❤️ and star this repo to support my project

Created & Maintained By

Brent Bulla (@outbred) (Insta)

If you found this project helpful or you learned something from the source code and want to thank me, consider buying me a cup of <img src="https://vignette.wikia.nocookie.net/logopedia/images/a/ad/Dr._Pepper_1958.jpg/revision/latest?cb=20100924201743" height="25em" /> - PayPal

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Broadcaster.PubSub.Framework:

Package Downloads
SimpleSamSettings.Framework

An easy to use, scalable, and cross-platform settings persistence framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.1 1,395 10/8/2018
1.0.0 753 10/7/2018

Updated icon