Created
February 5, 2013 11:42
-
-
Save SimonRichardson/4713952 to your computer and use it in GitHub Desktop.
HistoryController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HistoryController.hx | |
package controller; | |
import funk.actors.types.mvc.Controller; | |
import funk.actors.types.mvc.Model; | |
import funk.ioc.Inject; | |
import funk.types.Tuple2; | |
import model.HistoryModel; | |
import generic.event.Events; | |
using funk.types.extensions.Options; | |
using funk.reactive.extensions.Streams; | |
class HistoryController extends Controller<HistoryItem, Int> { | |
private var _events : Events; | |
public function new() { | |
super(); | |
model = Inject.as(HistoryModel).get(); | |
// Not sure if to do here or not? | |
_events = Inject.as(Events).get(); | |
_events.onDocumentChange().foreach(function(value) { | |
add(History(value)); | |
}); | |
} | |
} | |
// HistoryView.hx | |
package view.history; | |
import funk.collections.immutable.List; | |
import funk.actors.types.mvc.Model; | |
import funk.actors.types.mvc.View; | |
import funk.ioc.Inject; | |
import model.HistoryModel; | |
using funk.collections.immutable.extensions.Lists; | |
using funk.types.extensions.Options; | |
class HistoryView extends View<HistoryItem, Int> { | |
public function new() { | |
super(); | |
model = Inject.as(HistoryModel).get(); | |
} | |
override private function handle<R>(value : R) : Void { | |
trace(value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment