Skip to content

Commit

Permalink
Merge pull request #35 from RobotlegsJS/prettier
Browse files Browse the repository at this point in the history
Update Prettier Rules
  • Loading branch information
tiagoschenkel authored Jul 24, 2018
2 parents fb6ffe7 + e84b0a8 commit 2cd2986
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"printWidth": 80,
"printWidth": 140,
"tabWidth": 4,
"useTabs": false,
"semi": true,
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

- Update codeclimate settings (see #34).

- Update Prettier rules (see #35).

- Update dev dependencies to latest version.

### [v0.0.5](https://github.com/RobotlegsJS/RobotlegsJS-Phaser-SignalCommandMap/releases/tag/0.0.5) - 2017-09-26
Expand Down
16 changes: 4 additions & 12 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@
/**
* SignalCommandMap Extension
*/
export {
ISignalCommandMap
} from "./robotlegs/bender/extensions/signalCommandMap/api/ISignalCommandMap";
export {
SignalCommandMap
} from "./robotlegs/bender/extensions/signalCommandMap/impl/SignalCommandMap";
export {
SignalCommandTrigger
} from "./robotlegs/bender/extensions/signalCommandMap/impl/SignalCommandTrigger";
export {
SignalCommandMapExtension
} from "./robotlegs/bender/extensions/signalCommandMap/SignalCommandMapExtension";
export { ISignalCommandMap } from "./robotlegs/bender/extensions/signalCommandMap/api/ISignalCommandMap";
export { SignalCommandMap } from "./robotlegs/bender/extensions/signalCommandMap/impl/SignalCommandMap";
export { SignalCommandTrigger } from "./robotlegs/bender/extensions/signalCommandMap/impl/SignalCommandTrigger";
export { SignalCommandMapExtension } from "./robotlegs/bender/extensions/signalCommandMap/SignalCommandMapExtension";
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ export class SignalCommandMap implements ISignalCommandMap {
constructor(@inject(IContext) context: IContext) {
this._injector = context.injector;
this._logger = context.getLogger(this);
this._triggerMap = new CommandTriggerMap(
this.getKey,
this.createTrigger.bind(this)
);
this._triggerMap = new CommandTriggerMap(this.getKey, this.createTrigger.bind(this));
}

/*============================================================================*/
Expand Down Expand Up @@ -83,11 +80,7 @@ export class SignalCommandMap implements ISignalCommandMap {
/*============================================================================*/

private createTrigger(signalClass: Object): ICommandTrigger {
return new SignalCommandTrigger(
this._injector,
signalClass,
this._mappingProcessors
);
return new SignalCommandTrigger(this._injector, signalClass, this._mappingProcessors);
}

private getTrigger(signalClass: Object): SignalCommandTrigger {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,11 @@ export class SignalCommandTrigger implements ICommandTrigger {
/**
* @private
*/
constructor(
injector: IInjector,
signalClass: any,
processors?: Function[],
logger?: ILogger
) {
constructor(injector: IInjector, signalClass: any, processors?: Function[], logger?: ILogger) {
this._injector = injector;
this._signalClass = signalClass;
this._mappings = new CommandMappingList(this, processors, logger);
this._executor = new CommandExecutor(
injector,
this._mappings.removeMapping
);
this._executor = new CommandExecutor(injector, this._mappings.removeMapping);
}

/*============================================================================*/
Expand Down Expand Up @@ -100,10 +92,7 @@ export class SignalCommandTrigger implements ICommandTrigger {

private routePayloadToCommands = (...valueObjects): void => {
let valueClasses: any[] = valueObjects.map(obj => obj.constructor);
let payload: CommandPayload = new CommandPayload(
valueObjects,
valueClasses
);
let payload: CommandPayload = new CommandPayload(valueObjects, valueClasses);
this._executor.executeCommands(this._mappings.getList(), payload);
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ describe("SignalCommandMapExtension", () => {
context.install(SignalCommandMapExtension);
context.initialize();

let instance: ISignalCommandMap = context.injector.get<
ISignalCommandMap
>(ISignalCommandMap);
let instance: ISignalCommandMap = context.injector.get<ISignalCommandMap>(ISignalCommandMap);

instance.map(RelaySignal).toCommand(RelayCommand);
instance.map(TargetSignal).toCommand(TargetCommand);
Expand Down

0 comments on commit 2cd2986

Please sign in to comment.