@thi.ng/api
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -261,5 +261,5 @@ /** | ||
export interface IWatch<T> { | ||
addWatch(id: string, fn: Watch<T>): any; | ||
removeWatch(id: string): any; | ||
addWatch(id: string, fn: Watch<T>): boolean; | ||
removeWatch(id: string): boolean; | ||
notifyWatches(oldState: T, newState: T): any; | ||
} |
@@ -6,2 +6,13 @@ # Change Log | ||
<a name="1.4.0"></a> | ||
# [1.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@1.3.0...@thi.ng/api@1.4.0) (2018-01-29) | ||
### Features | ||
* **api:** update IWatch & mixin, boolean returns ([bddd5ce](https://github.com/thi-ng/umbrella/commit/bddd5ce)) | ||
<a name="1.3.0"></a> | ||
@@ -8,0 +19,0 @@ # [1.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/api@1.2.1...@thi.ng/api@1.3.0) (2018-01-28) |
@@ -8,7 +8,15 @@ "use strict"; | ||
this._watches = this._watches || {}; | ||
if (this._watches[id]) { | ||
return false; | ||
} | ||
this._watches[id] = fn; | ||
return true; | ||
}, | ||
removeWatch(id) { | ||
this._watches = this._watches || {}; | ||
delete this._watches[id]; | ||
if (this._watches[id]) { | ||
delete this._watches[id]; | ||
return true; | ||
} | ||
return false; | ||
}, | ||
@@ -15,0 +23,0 @@ notifyWatches(oldState, newState) { |
{ | ||
"name": "@thi.ng/api", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Common, generic types & interfaces for thi.ng projects", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
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
33410
688