I was first introduced to reactive programming with ReactiveCocoa several years ago. In there they had the notion on RACCommand
s, which was carried over to RxSwift with the extension library Action.
As stated on their GitHub page:
An action is a way to say "hey, later I'll need you to subscribe to this thing."
Actions accept a
workFactory
: a closure that takes some input and produces an observable. Whenexecute()
is called, it passes its parameter to this closure and subscribes to the work.
- Can only be executed while "enabled" (true if unspecified).
- Only execute one thing at a time.
- Aggregates next/error events across individual executions.
In my experience it is an absolutely indispensable tool in the reactive programming toolbox when doing robust, reactive iOS development.
Now we would like to carry this over to Android app as well. But after countless hours of research I have not been able to find a corresponding component for either RxJava or RxKotlin.
The implementation in Swift is relatively straight forward, so we could just port it, but I'd first like to hear if:
We ended up porting the iOS version ourselves.
It's open source and can be found here: https://github.com/tonsser/kaction