Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Create #groovylang code that run in groovy, java and javascript environments
GrooscriptObservable.fromList(["one", "two", "three"])
.subscribe({arg -> println(arg)})
//In groovy and converted code in js, you get in console:
import org.grooscript.asts.GsNative
class GrooscriptObservable<T> {
def observable
GrooscriptObservable(List list) {
this.observable = platformObservable(list)
def methodMissing(String name, args) {
static fromList(List list) {
new GrooscriptObservable(list)
private platformObservable(List list) {/*
return Rx.Observable.from(list);
Class.forName("rx.Observable").invokeMethod("from", list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment