abstract-object
Advanced tools
Comparing version 1.6.4 to 1.6.5
@@ -26,2 +26,4 @@ (function() { | ||
module.exports = AbstractObject = (function() { | ||
var s, vState, vStateName; | ||
inherits(AbstractObject, EventEmitter); | ||
@@ -45,2 +47,12 @@ | ||
for (vStateName in OBJECT_STATES) { | ||
vState = OBJECT_STATES[vStateName]; | ||
s = 'is' + vStateName[0].toUpperCase() + vStateName.slice(1); | ||
AbstractObject.prototype[s] = (function(aState) { | ||
return function() { | ||
return this._objectState_ === aState; | ||
}; | ||
})(vState); | ||
} | ||
AbstractObject.prototype.setObjectState = function(value, emitted) { | ||
@@ -47,0 +59,0 @@ if (emitted == null) { |
{ | ||
"name": "abstract-object", | ||
"version": "1.6.4", | ||
"version": "1.6.5", | ||
"description": "AbstractObject with Object State Events Support, RefObject with RefCount and AddRef/Release Support.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/snowyu/abstract-object", |
@@ -16,4 +16,6 @@ # AbtractObject [![Build Status](https://img.shields.io/travis/snowyu/abstract-object/master.png)](http://travis-ci.org/snowyu/abstract-object) [![npm](https://img.shields.io/npm/v/abstract-object.svg)](https://npmjs.org/package/abstract-object) [![downloads](https://img.shields.io/npm/dm/abstract-object.svg)](https://npmjs.org/package/abstract-object) [![license](https://img.shields.io/npm/l/abstract-object.svg)](https://npmjs.org/package/abstract-object) | ||
* `...`: the constructor's arguments should be passed into init method. | ||
* `final`: abstract finalization method before the instance destroying. | ||
* `free`: free the class instance. | ||
* `final`(...): abstract finalization method before the instance destroying. | ||
* `...`: the free(destroy)'s arguments should be passed into final method. | ||
* `free`(...): free the class instance. | ||
* `...`: optional arguments will be passed into final method to process. | ||
* `dispatch`(event, args[, callback]): dispath an event or callback | ||
@@ -26,2 +28,4 @@ * `event`: the event name | ||
* `callback`: optional, it will not dispatch `'error'` event if the callback is exists, unless the callback return false. | ||
* `isIniting`(), `isInited`(),`isDestroying`(), `isDestroyed`() methods: | ||
* to test object state methods | ||
@@ -28,0 +32,0 @@ * Events: |
Sorry, the diff of this file is not supported yet
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
87540
999
197