Skip to content

Robotlegs extension to facilitate the use of AS3-Signals with Robotlegs commands

License

Notifications You must be signed in to change notification settings

ccapndave/signals-extensions-CommandSignal

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This fork is a quick and dirty edit of Joel Hooks' original signals-extension-CommandSignal that allows the signal arguments to be passed into the execute() method as parameters instead of being injected into the command. This allows signals to trigger commands with multiple parameters of the same type, and also allows optional arguments.

Disclaimer

The code needs some unit tests, and support for GuardedSignals needs to be added. I will get round to doing this at some point, or if anyone else would like to contribute these bits please feel free!

Usage

To make use of this functionality your command needs to extend SignalArgumentsCommand and implement an execute() method:

// The command class
public class MyCommand extends SignalArgumentsCommand {

   [Inject] 
   public var myModel:MyModel;

   public function execute(param1:String, param2:String, param3:Boolean):void {
   }

 }

// The signal
var executeMyCommandSignal:Signal = new Signal(String, String, Boolean);

Note that if the command doesn't extend SignalArgumentsCommand the parameters will get injected as usual.

Many thanks to Michael Cann who came up with the idea in this thread

SignalCommandMap

The SignalCommandMap is an extension for the Robotlegs-AS3 micro-architecture that makes use of AS3-Signals to trigger commands.

Requires Robotlegs 1.1

Here is an example and more details

About

Robotlegs extension to facilitate the use of AS3-Signals with Robotlegs commands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • ActionScript 100.0%