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

How cancel subscription ? #401

Open
rullyalves opened this issue Aug 5, 2023 · 0 comments
Open

How cancel subscription ? #401

rullyalves opened this issue Aug 5, 2023 · 0 comments
Labels
question Question regarding how RxGo is working etc.

Comments

@rullyalves
Copy link

I would like to add subscribers and unsubscribe something like create a subscription and be able to unsubscribe the specific subscription without breaking the observable completely

	ch := make(chan rxgo.Item)
	obs := rxgo.FromChannel(ch, rxgo.WithPublishStrategy())
        obs.Connect()
        newObs := obs.Map(func(ctx context.Context, i interface{}) (interface{}, error) {
		return i.(int) * 2, nil
	})
	
	dispose := newObs.DoOnNext(func(i interface{}) {
		fmt.Println(i)
	})
	
	dispose()
@rullyalves rullyalves added the question Question regarding how RxGo is working etc. label Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question regarding how RxGo is working etc.
Projects
None yet
Development

No branches or pull requests

1 participant