Skip to content

Instantly share code, notes, and snippets.

@dpeek
Created August 8, 2013 13:44
Show Gist options
  • Save dpeek/6184694 to your computer and use it in GitHub Desktop.
Save dpeek/6184694 to your computer and use it in GitHub Desktop.
class Main
{
static function main()
{
var context = new MyContext(new View());
}
}
class MyContext extends mmvc.impl.Context
{
public function new(context:mmvc.api.IViewContainer)
{
super(context);
}
override function startup()
{
super.startup();
commandMap.mapSignalClass(MySignal, MyCommand1);
commandMap.mapSignalClass(MySignal, MyCommand2);
var signal = injector.getInstance(MySignal);
signal.dispatch();
}
}
class View implements mmvc.api.IViewContainer
{
public function new() {}
public var viewAdded:Dynamic -> Void;
public var viewRemoved:Dynamic -> Void;
public function isAdded(view:Dynamic):Bool return true;
}
class MySignal extends msignal.Signal.Signal0
{
public function new() super();
}
class MyCommand1 extends mmvc.impl.Command
{
override function execute() trace("command 1");
}
class MyCommand2 extends mmvc.impl.Command
{
override function execute() trace("command 2");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment