djinn-state
Advanced tools
Comparing version 0.0.2 to 0.1.0
@@ -33,2 +33,3 @@ import { DjinnService } from './DjinnService'; | ||
getService: <T>(service: new () => T) => T; | ||
remove(service: any): void; | ||
} | ||
@@ -35,0 +36,0 @@ interface IDjinnServiceRegister { |
@@ -78,4 +78,8 @@ "use strict"; | ||
} | ||
Djinn.prototype.remove = function (service) { | ||
var serviceName = service.name; | ||
delete this.__services[serviceName]; | ||
}; | ||
return Djinn; | ||
}()); | ||
exports.Djinn = Djinn; |
{ | ||
"name": "djinn-state", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "Powerful yet simple state machine", | ||
"main": "dist/index.js", | ||
"repository": "https://github.com/djinn-state/djinn-state.git", | ||
"author": "Gilmar Quinelato <gilmarsquinelato@gmail.com>", | ||
"license": "MIT", | ||
@@ -7,0 +9,0 @@ "scripts": { |
# Djinn-state | ||
[![Build Status](https://travis-ci.com/gilmarsquinelato/djinn-state.svg?branch=master)](https://travis-ci.com/gilmarsquinelato/djinn-state) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/dc067eab06d44cedbbc2dfceeeb8ec38)](https://www.codacy.com/app/gilmarsquinelato/djinn-state?utm_source=github.com&utm_medium=referral&utm_content=gilmarsquinelato/djinn-state&utm_campaign=Badge_Grade) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/dc067eab06d44cedbbc2dfceeeb8ec38)](https://www.codacy.com/app/gilmarsquinelato/djinn-state?utm_source=github.com&utm_medium=referral&utm_content=gilmarsquinelato/djinn-state&utm_campaign=Badge_Coverage) | ||
[![Build Status](https://travis-ci.com/djinn-state/djinn-state.svg?branch=master)](https://travis-ci.com/djinn-state/djinn-state) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/dc067eab06d44cedbbc2dfceeeb8ec38)](https://www.codacy.com/app/djinn-state/djinn-state?utm_source=github.com&utm_medium=referral&utm_content=gilmarsquinelato/djinn-state&utm_campaign=Badge_Grade) | ||
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/dc067eab06d44cedbbc2dfceeeb8ec38)](https://www.codacy.com/app/djinn-state/djinn-state?utm_source=github.com&utm_medium=referral&utm_content=gilmarsquinelato/djinn-state&utm_campaign=Badge_Coverage) | ||
[![](https://img.shields.io/david/gilmarsquinelato/djinn-state.svg)](https://github.com/gilmarsquinelato/djinn-state) | ||
[![](https://img.shields.io/david/djinn-state/djinn-state.svg)](https://github.com/djinn-state/djinn-state) | ||
[![](https://img.shields.io/npm/dw/djinn-state.svg)](https://www.npmjs.com/package/djinn-state) | ||
@@ -12,3 +12,3 @@ [![](https://img.shields.io/bundlephobia/minzip/djinn-state.svg)](https://www.npmjs.com/package/djinn-state) | ||
A powerful yet simple state machine. | ||
A powerful yet simple application state management. | ||
@@ -15,0 +15,0 @@ The Djinn-state was developed with the objective to be less verbose and simple to maintain and scale Javascript applications. |
@@ -76,2 +76,12 @@ import { Djinn} from '../Djinn'; | ||
}); | ||
it('should remove a service', () => { | ||
const djinn = new Djinn(); | ||
djinn.register(FakeService); | ||
djinn.remove(FakeService); | ||
const services = djinn.getRegisteredServices(); | ||
expect(Object.keys(services).length).toBe(0); | ||
}); | ||
}); |
@@ -76,2 +76,7 @@ import { DjinnService } from './DjinnService'; | ||
}; | ||
remove(service: any) { | ||
const serviceName = (<any>service).name; | ||
delete this.__services[serviceName]; | ||
} | ||
} | ||
@@ -78,0 +83,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
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 contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
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
19174
428
2