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

FeatureRequest: Add handlers for selectors #50

Open
maximkrouk opened this issue Jun 21, 2021 · 4 comments · May be fixed by #88
Open

FeatureRequest: Add handlers for selectors #50

maximkrouk opened this issue Jun 21, 2021 · 4 comments · May be fixed by #88
Labels
bug Something isn't working

Comments

@maximkrouk
Copy link

maximkrouk commented Jun 21, 2021

Feature request

In ReactiveCocoa there is an ability to subscribe to object selector's trigger like

navigationController?.reactive
        .trigger(for: #selector(UINavigationController.popViewController))
        .producer.observe(on: UIScheduler()).startWithValues { ... }

I think this feature is very useful and it would be great if Combine had this ability too 🙏

@maximkrouk maximkrouk added the bug Something isn't working label Jun 21, 2021
@maximkrouk maximkrouk changed the title Add handlers for selectors FeatureRequest: Add handlers for selectors Jun 21, 2021
@maximkrouk
Copy link
Author

maximkrouk commented Jun 25, 2021

Btw I implemented it here (took ReactiveCocoa/ReactiveSwift as a reference), but I changed indentation and added macOS support (not features adoption, but an ability to build), removed carthage & cocoapods support and updated readme a bit, so I don't think the PR is useful, and if you interested, you can adopt this feature manually or tell me to create a PR anyway 🙂

Example:

navigationController?.publisher(for: #selector(UINavigationController.popViewController))

@viewDidAppear
Copy link

viewDidAppear commented Jul 27, 2023

@maximkrouk This is BRILLIANT!!! Just what I need to finally completely remove RxSwift from my project. Do you mind to make a PR? It's a bit old, do you need any help updating it for usage?

@maximkrouk
Copy link
Author

Hello @viewDidAppear, I just extracted this logic to combine-interception package, it should be compatible with CombineExt/CombineCocoa

@viewDidAppear viewDidAppear linked a pull request Jul 27, 2023 that will close this issue
@viewDidAppear
Copy link

viewDidAppear commented Jul 27, 2023

Oh @maximkrouk Thanks! I didn't see this so I prepared a PR of my own, with a fork against current master. Let me see if I can use your package instead 🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants