djinn-state
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -33,3 +33,7 @@ import { DjinnService } from './DjinnService'; | ||
getService: <T>(service: new () => T) => T; | ||
remove(service: any): void; | ||
/** | ||
* Remove a registered service | ||
* @param service The service class to be removed | ||
*/ | ||
remove: (service: any) => void; | ||
} | ||
@@ -44,1 +48,2 @@ interface IDjinnServiceRegister { | ||
export {}; | ||
//# sourceMappingURL=Djinn.d.ts.map |
@@ -13,3 +13,3 @@ "use strict"; | ||
}; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var DjinnService_1 = require("./DjinnService"); | ||
@@ -78,9 +78,14 @@ /** | ||
}; | ||
/** | ||
* Remove a registered service | ||
* @param service The service class to be removed | ||
*/ | ||
this.remove = function (service) { | ||
var serviceName = service.name; | ||
delete _this.__services[serviceName]; | ||
delete _this.__servicesSingletons[serviceName]; | ||
}; | ||
} | ||
Djinn.prototype.remove = function (service) { | ||
var serviceName = service.name; | ||
delete this.__services[serviceName]; | ||
}; | ||
return Djinn; | ||
}()); | ||
exports.Djinn = Djinn; |
@@ -20,1 +20,2 @@ export declare class DjinnService { | ||
export {}; | ||
//# sourceMappingURL=DjinnService.d.ts.map |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var DjinnService = /** @class */ (function () { | ||
@@ -17,3 +17,3 @@ function DjinnService() { | ||
current: newState[key], | ||
previous: _this.state[key] | ||
previous: _this.state[key], | ||
}; | ||
@@ -20,0 +20,0 @@ _this.state[key] = newState[key]; |
export { Djinn } from './Djinn'; | ||
export { DjinnService } from './DjinnService'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
exports.__esModule = true; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var Djinn_1 = require("./Djinn"); | ||
@@ -4,0 +4,0 @@ exports.Djinn = Djinn_1.Djinn; |
{ | ||
"name": "djinn-state", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Powerful yet simple state machine", | ||
"main": "dist/index.js", | ||
"repository": "https://github.com/djinn-state/djinn-state.git", | ||
"repository": "https://github.com/djinn-state/djinn-core.git", | ||
"author": "Gilmar Quinelato <gilmarsquinelato@gmail.com>", | ||
"license": "MIT", | ||
"keywords": [ | ||
"javascript", | ||
"typescript", | ||
"nodejs", | ||
"browser", | ||
"application-state", | ||
"state-management", | ||
"services", | ||
"djinn", | ||
"@djinn" | ||
], | ||
"scripts": { | ||
@@ -13,3 +24,3 @@ "test": "jest", | ||
"build": "yarn build:ts", | ||
"build:ts": "tsc --outDir ./dist -d ./src/index.ts", | ||
"build:ts": "tsc -p tsconfig.json", | ||
"test:send-coverage": "cat ./coverage/lcov.info | yarn codacy-coverage --language typescript" | ||
@@ -16,0 +27,0 @@ }, |
@@ -26,5 +26,5 @@ # Djinn-state | ||
npm ```npm i --save djinn-state``` | ||
npm `npm i --save djinn-state` | ||
yarn ```yarn add djinn-state``` | ||
yarn `yarn add djinn-state` | ||
@@ -31,0 +31,0 @@ ## Using |
@@ -77,6 +77,11 @@ import { DjinnService } from './DjinnService'; | ||
remove(service: any) { | ||
/** | ||
* Remove a registered service | ||
* @param service The service class to be removed | ||
*/ | ||
remove = (service: any) => { | ||
const serviceName = (<any>service).name; | ||
delete this.__services[serviceName]; | ||
} | ||
delete this.__servicesSingletons[serviceName]; | ||
}; | ||
} | ||
@@ -83,0 +88,0 @@ |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
21304
17
442