Skip to content

Commit

Permalink
cleans up some readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
creynders committed Jun 4, 2013
1 parent b82a1b0 commit 119f3a6
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/robotlegs/bender/extensions/contextView/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Note: The ContextViewExtension must be installed before the ContextView is provi

In the example above we provide the instance "this" to use as the view. We assume that "this" is a valid DisplayObjectContainer.

## StageSync Extension (Bundled with MVCS)
# StageSync Extension (Bundled with MVCS)

The Stage Sync Extension waits for a ContextView to be added as a configuration, and initializes and destroys the context based on the contextView's stage presence.

Expand Down
2 changes: 1 addition & 1 deletion src/robotlegs/bender/extensions/enhancedLogging/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class MyClass
public function explode(size:String):void
{
logger.info("The was a {0} explosion!", [size]);
logger.info("This was a {0} explosion!", [size]);
}
}
```
Expand Down
42 changes: 41 additions & 1 deletion src/robotlegs/bender/extensions/eventCommandMap/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,47 @@ eventCommandMap
eventDispatcher.dispatchEvent(new SignOutEvent(SignOutEvent.SIGN_OUT));
```

Note: for a less verbose and more performant command mechanism see the MessageCommandMap extension.
## Event instance access inside commands

Commands are automatically injected with the event instance that triggered them, resolved to the type used for the mapping.

### Concrete event types

```as3
eventCommandMap
.map(SignOutEvent.SIGN_OUT, SignOutEvent) //the second parameter defines the type of event instance injection
.toCommand(SignOutCommand);
```
```as3
//SignOutCommand
[Inject]
public var event: SignOutEvent; //as mapped
public function execute():void{
//do something useful with event
}
```

### Abstract event types

```as3
eventCommandMap
.map(SignOutEvent.SIGN_OUT, Event) //the second parameter defines the type of event instance injection
.toCommand(SignOutCommand);
```
```as3
//SignOutCommand
[Inject]
public var event: Event; //as mapped
public function execute():void{
//do something useful with event
}
```

### Note: this deviates from Robotlegs v1 functionality

In Robotlegs v1 an event instance was automatically mapped both to the concrete event type and the abstract `Event` type.

## Mapping 'once' commands

Expand Down
4 changes: 2 additions & 2 deletions src/robotlegs/bender/extensions/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ The unit tests for an extension should be packaged thusly:
superDuper
SuperDuperExtensionTest
SuperDuperExtensionTestSuite
api
SuperDuperErrorTest
api
SuperDuperErrorTest
impl
SuperDuperTest
support
Expand Down

0 comments on commit 119f3a6

Please sign in to comment.