upta/pubsub

Documentation - Unsubscribe example should include 'this' parameter

RobbiewOnline opened this issue · 0 comments

Because your example for subscribing passes this then I recommend changing the unsubscribe documentation to match, i.e. from

public class Page
{
	Hub hub = Hub.Default;
	
	public void WereDoneHere()
	{
		hub.Unsubscribe<Product>();
	}
}

to

public class Page
{
	Hub hub = Hub.Default;
	
	public void WereDoneHere()
	{
		hub.Unsubscribe<Product>(this);
	}
}

Otherwise those using the current example as-is (copy & paste) will likely accidentally unsubscribe all their listeners from the hub in error, rather than from their specific object / subscriber instance.