Skip to content

Instantly share code, notes, and snippets.

@notyy
Created June 29, 2016 13:30
Show Gist options
  • Save notyy/66e7c7d766ea00f02bb59501b5404f7f to your computer and use it in GitHub Desktop.
Save notyy/66e7c7d766ea00f02bb59501b5404f7f to your computer and use it in GitHub Desktop.
trait ReactiveComponent[Input, Output]
trait SimpleTransformation[Input, Output] extends ReactiveComponent[Input, Output] {
val outer = this
def update(input: Input): Output
def conn[Output1](nextSimpleTrans: SimpleTransformation[Output, Output1]): SimpleTransformation[Input, Output1] = {
new SimpleTransformation[Input, Output1] {
override def update(input: Input): Output1 = {
val output: Output = outer.update(input) //outer.update return's Output1 type?
nextSimpleTrans.update(output)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment