MetaRx
MetaRx copied to clipboard
Complex Algorithms
It would be incredible if MetaRx could support even more complex algorithms with more advanced logic via Macros. For example, something like this:
val sub: Sub[Double] = Sub(0.0)
sub := subscribe {
if (otherVar.get > 5.0) {
otherVar + anotherVar
} else {
anotherVar
}
}
The Macro would track all ReadChannel instances used within the block and update the resulting ReadChannel generated from the subscribe call. This would allow things like for-loops, conditionals, etc. to be used with simple logic, but become a ReadChannel that would fire events when any dependency changed.
see also https://github.com/lihaoyi/scala.rx for inspiration, the Rx { code } syntax is similiar to this feaure