react-services-injector
Advanced tools
Comparing version 1.0.0-rc.4 to 1.0.0-rc.5
@@ -167,3 +167,3 @@ 'use strict'; | ||
return services.reduce(function (store, service) { | ||
return _extends(store, _defineProperty({}, service.constructor.name, service)); | ||
return _extends(store, _defineProperty({}, service.constructor.publicName || service.constructor.name, service)); | ||
}, {}); | ||
@@ -201,3 +201,3 @@ } | ||
instance.services = this.toObject(services); | ||
instance.services = _extends({}, injector.get()); | ||
@@ -281,4 +281,8 @@ this.components.push({ | ||
try { | ||
console.group(this.constructor.name + '.' + method); | ||
var prototype = Object.getPrototypeOf(this); | ||
var _constructor = prototype && prototype.constructor; | ||
var name = _constructor && _constructor.publicName; | ||
console.group((name || this.constructor.name) + '.' + method); | ||
if (args && args.length) console.log('Arguments:', args); | ||
@@ -285,0 +289,0 @@ |
12
index.js
@@ -117,3 +117,3 @@ let Service = function () { | ||
toObject(services) { | ||
return services.reduce((store, service) => Object.assign(store, {[service.constructor.name]: service}), {}); | ||
return services.reduce((store, service) => Object.assign(store, {[service.constructor.publicName || service.constructor.name]: service}), {}); | ||
} | ||
@@ -141,3 +141,3 @@ | ||
instance.services = this.toObject(services); | ||
instance.services = Object.assign({}, injector.get()); | ||
@@ -205,4 +205,8 @@ this.components.push({ | ||
try { | ||
console.group(`${this.constructor.name}.${method}`); | ||
const prototype = Object.getPrototypeOf(this); | ||
const constructor = prototype && prototype.constructor; | ||
const name = constructor && constructor.publicName; | ||
console.group(`${name || this.constructor.name}.${method}`); | ||
if (args && args.length) | ||
@@ -235,2 +239,2 @@ console.log('Arguments:', args); | ||
exports.addExecutionHandler = addExecutionHandler; | ||
} | ||
} |
{ | ||
"name": "react-services-injector", | ||
"version": "1.0.0-rc.4", | ||
"version": "1.0.0-rc.5", | ||
"description": "A library to create and use sigleton-services in your React application.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80839
8
438