Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation - Unsubscribe example should include 'this' parameter #42

Open
RobbiewOnline opened this issue Mar 31, 2022 · 0 comments
Open

Comments

@RobbiewOnline
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant