@politie/ngx-sherlock
Advanced tools
Comparing version 1.0.0-beta.7 to 1.0.0-beta.10
@@ -6,2 +6,11 @@ import { ChangeDetectorRef, NgModule, Pipe, WrappedValue } from '@angular/core'; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @record | ||
* @template T | ||
*/ | ||
/** | ||
* @param {?} obj | ||
@@ -25,2 +34,6 @@ * @return {?} | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* Error thrown when an invalid argument has been provided to a pipe. | ||
@@ -32,6 +45,4 @@ */ | ||
* Calls the super class BaseError with a helpful error message. | ||
\@param type Pipe that was provided with an invalid argument | ||
\@param value Invalid argument provided | ||
* @param {?} type | ||
* @param {?} value | ||
* @param type Pipe that was provided with an invalid argument | ||
* @param value Invalid argument provided | ||
*/ | ||
@@ -45,2 +56,11 @@ function InvalidPipeArgumentError(type, value) { | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* Base reaction strategy. | ||
* @record | ||
*/ | ||
/** | ||
* Reaction strategy for Derivable values. | ||
@@ -53,11 +73,23 @@ */ | ||
* Sets up the reaction. | ||
\@param async provided derivable | ||
\@param updateLatestValue function to run whenever a new value is emitted | ||
* | ||
* @param async provided derivable | ||
* @param updateLatestValue function to run whenever a new value is emitted | ||
*/ | ||
/** | ||
* Sets up the reaction. | ||
* | ||
* @template T | ||
* @param {?} async | ||
* @param {?} updateLatestValue | ||
* @param {?} async provided derivable | ||
* @param {?} updateLatestValue function to run whenever a new value is emitted | ||
* @return {?} | ||
*/ | ||
DerivableStrategy.prototype.createReaction = function (async, updateLatestValue) { | ||
DerivableStrategy.prototype.createReaction = /** | ||
* Sets up the reaction. | ||
* | ||
* @template T | ||
* @param {?} async provided derivable | ||
* @param {?} updateLatestValue function to run whenever a new value is emitted | ||
* @return {?} | ||
*/ | ||
function (async, updateLatestValue) { | ||
this.dispose = async.react(updateLatestValue); | ||
@@ -75,11 +107,23 @@ }; | ||
* Sets up the reaction. | ||
\@param async provided derivableProxy | ||
\@param updateLatestValue function to run whenever a new value is emitted | ||
* | ||
* @param async provided derivableProxy | ||
* @param updateLatestValue function to run whenever a new value is emitted | ||
*/ | ||
/** | ||
* Sets up the reaction. | ||
* | ||
* @template T | ||
* @param {?} async | ||
* @param {?} updateLatestValue | ||
* @param {?} async provided derivableProxy | ||
* @param {?} updateLatestValue function to run whenever a new value is emitted | ||
* @return {?} | ||
*/ | ||
DerivableProxyStrategy.prototype.createReaction = function (async, updateLatestValue) { | ||
DerivableProxyStrategy.prototype.createReaction = /** | ||
* Sets up the reaction. | ||
* | ||
* @template T | ||
* @param {?} async provided derivableProxy | ||
* @param {?} updateLatestValue function to run whenever a new value is emitted | ||
* @return {?} | ||
*/ | ||
function (async, updateLatestValue) { | ||
this.dispose = async.$react(updateLatestValue); | ||
@@ -91,13 +135,13 @@ }; | ||
* The {\@link ValuePipe} can be used to unwrap `Derivable` or `DerivableProxy` values in templates. Like Angular's | ||
[AsyncPipe]{\@link https://angular.io/api/common/AsyncPipe}, the | ||
[ChangeDetectorRef]{\@link https://angular.io/api/core/ChangeDetectorRef} of the `\@Host()` component will be `markedForCheck` whenever | ||
the provided value emits a new value. Usage is as follows: | ||
```html | ||
<!-- both title$ and someText$ are derivable values in MyComponent class --> | ||
<my-component | ||
[title]="title$ | value"> | ||
<p>{{someText$ | value}}</p> | ||
</my-component> | ||
``` | ||
* [AsyncPipe]{\@link https://angular.io/api/common/AsyncPipe}, the | ||
* [ChangeDetectorRef]{\@link https://angular.io/api/core/ChangeDetectorRef} of the `\@Host()` component will be `markedForCheck` whenever | ||
* the provided value emits a new value. Usage is as follows: | ||
* | ||
* ```html | ||
* <!-- both title$ and someText$ are derivable values in MyComponent class --> | ||
* <my-component | ||
* [title]="title$ | value"> | ||
* <p>{{someText$ | value}}</p> | ||
* </my-component> | ||
* ``` | ||
*/ | ||
@@ -107,5 +151,4 @@ var ValuePipe = /** @class */ (function () { | ||
* The ValuePipe parses derivable values in ontology objects and returns the literal value. When a state update occurs, the change | ||
detection is marked for check. It functions similarly to Angular's AsyncPipe and can be used in templates. | ||
\@param ref {ChangeDetectorRef} Angular change detection reference | ||
* @param {?} ref | ||
* detection is marked for check. It functions similarly to Angular's AsyncPipe and can be used in templates. | ||
* @param ref {ChangeDetectorRef} Angular change detection reference | ||
*/ | ||
@@ -129,9 +172,16 @@ function ValuePipe(ref) { | ||
*/ | ||
this.strategy = undefined; | ||
this.strategy = /** @type {?} */ ((undefined)); | ||
} | ||
/** | ||
* Called when `@Host()` component gets destroyed. | ||
*/ | ||
/** | ||
* Called when `\@Host()` component gets destroyed. | ||
* @return {?} | ||
*/ | ||
ValuePipe.prototype.ngOnDestroy = function () { | ||
ValuePipe.prototype.ngOnDestroy = /** | ||
* Called when `\@Host()` component gets destroyed. | ||
* @return {?} | ||
*/ | ||
function () { | ||
if (this.strategy) { | ||
@@ -146,3 +196,8 @@ this.dispose(); | ||
*/ | ||
ValuePipe.prototype.transform = function (obj) { | ||
ValuePipe.prototype.transform = /** | ||
* @template T | ||
* @param {?} obj | ||
* @return {?} | ||
*/ | ||
function (obj) { | ||
if (!this.storedObj) { | ||
@@ -170,3 +225,8 @@ if (obj) { | ||
*/ | ||
ValuePipe.prototype.subscribe = function (obj) { | ||
ValuePipe.prototype.subscribe = /** | ||
* @template T | ||
* @param {?} obj | ||
* @return {?} | ||
*/ | ||
function (obj) { | ||
var _this = this; | ||
@@ -182,3 +242,8 @@ this.storedObj = obj; | ||
*/ | ||
ValuePipe.prototype.selectStrategy = function (obj) { | ||
ValuePipe.prototype.selectStrategy = /** | ||
* @template T | ||
* @param {?} obj | ||
* @return {?} | ||
*/ | ||
function (obj) { | ||
if (isDerivableProxy(obj)) { | ||
@@ -199,3 +264,8 @@ return new DerivableProxyStrategy(); | ||
*/ | ||
ValuePipe.prototype.updateLatestValue = function (value) { | ||
ValuePipe.prototype.updateLatestValue = /** | ||
* @template T | ||
* @param {?} value | ||
* @return {?} | ||
*/ | ||
function (value) { | ||
this.latestValue = value; | ||
@@ -207,3 +277,6 @@ this.ref.markForCheck(); | ||
*/ | ||
ValuePipe.prototype.dispose = function () { | ||
ValuePipe.prototype.dispose = /** | ||
* @return {?} | ||
*/ | ||
function () { | ||
this.strategy.dispose(); | ||
@@ -218,5 +291,3 @@ this.latestValue = undefined; | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
/** @nocollapse */ | ||
ValuePipe.ctorParameters = function () { return [ | ||
@@ -228,2 +299,6 @@ { type: ChangeDetectorRef, }, | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
var NgxSherlockModule = /** @class */ (function () { | ||
@@ -242,5 +317,3 @@ function NgxSherlockModule() { | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
/** @nocollapse */ | ||
NgxSherlockModule.ctorParameters = function () { return []; }; | ||
@@ -251,5 +324,15 @@ return NgxSherlockModule; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* This function automatically detects changes when any `Derivable` or `DerivableProxy` in a consuming template changes state. | ||
\@param detector `ChangeDetectorRef` instance passed in by a consuming component. | ||
* @param {?} detector | ||
* Tries to detect changes. When that fails due to a template error, will detach the `ChangeDetectorRef` and rethrow | ||
* said error. | ||
* @param {?} detector `ChangeDetectorRef` instance passed in by a consuming component. | ||
* @return {?} | ||
@@ -261,3 +344,11 @@ */ | ||
} | ||
detector.onDestroy(derivation(function () { return detector.detectChanges(); }).react(function () { return void 0; })); | ||
detector.onDestroy(derivation(function () { | ||
try { | ||
detector.detectChanges(); | ||
} | ||
catch (/** @type {?} */ error) { | ||
detector.detach(); | ||
throw error; | ||
} | ||
}).react(function () { return void 0; })); | ||
} | ||
@@ -273,2 +364,21 @@ /** | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* Generated bundle index. Do not edit. | ||
@@ -275,0 +385,0 @@ */ |
@@ -6,2 +6,11 @@ import { ChangeDetectorRef, NgModule, Pipe, WrappedValue } from '@angular/core'; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @record | ||
* @template T | ||
*/ | ||
/** | ||
* @param {?} obj | ||
@@ -15,2 +24,6 @@ * @return {?} | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* Error thrown when an invalid argument has been provided to a pipe. | ||
@@ -21,6 +34,4 @@ */ | ||
* Calls the super class BaseError with a helpful error message. | ||
\@param type Pipe that was provided with an invalid argument | ||
\@param value Invalid argument provided | ||
* @param {?} type | ||
* @param {?} value | ||
* @param {?} type Pipe that was provided with an invalid argument | ||
* @param {?} value Invalid argument provided | ||
*/ | ||
@@ -33,2 +44,11 @@ constructor(type, value) { | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* Base reaction strategy. | ||
* @record | ||
*/ | ||
/** | ||
* Reaction strategy for Derivable values. | ||
@@ -39,8 +59,6 @@ */ | ||
* Sets up the reaction. | ||
\@param async provided derivable | ||
\@param updateLatestValue function to run whenever a new value is emitted | ||
* | ||
* @template T | ||
* @param {?} async | ||
* @param {?} updateLatestValue | ||
* @param {?} async provided derivable | ||
* @param {?} updateLatestValue function to run whenever a new value is emitted | ||
* @return {?} | ||
@@ -58,8 +76,6 @@ */ | ||
* Sets up the reaction. | ||
\@param async provided derivableProxy | ||
\@param updateLatestValue function to run whenever a new value is emitted | ||
* | ||
* @template T | ||
* @param {?} async | ||
* @param {?} updateLatestValue | ||
* @param {?} async provided derivableProxy | ||
* @param {?} updateLatestValue function to run whenever a new value is emitted | ||
* @return {?} | ||
@@ -73,13 +89,13 @@ */ | ||
* The {\@link ValuePipe} can be used to unwrap `Derivable` or `DerivableProxy` values in templates. Like Angular's | ||
[AsyncPipe]{\@link https://angular.io/api/common/AsyncPipe}, the | ||
[ChangeDetectorRef]{\@link https://angular.io/api/core/ChangeDetectorRef} of the `\@Host()` component will be `markedForCheck` whenever | ||
the provided value emits a new value. Usage is as follows: | ||
```html | ||
<!-- both title$ and someText$ are derivable values in MyComponent class --> | ||
<my-component | ||
[title]="title$ | value"> | ||
<p>{{someText$ | value}}</p> | ||
</my-component> | ||
``` | ||
* [AsyncPipe]{\@link https://angular.io/api/common/AsyncPipe}, the | ||
* [ChangeDetectorRef]{\@link https://angular.io/api/core/ChangeDetectorRef} of the `\@Host()` component will be `markedForCheck` whenever | ||
* the provided value emits a new value. Usage is as follows: | ||
* | ||
* ```html | ||
* <!-- both title$ and someText$ are derivable values in MyComponent class --> | ||
* <my-component | ||
* [title]="title$ | value"> | ||
* <p>{{someText$ | value}}</p> | ||
* </my-component> | ||
* ``` | ||
*/ | ||
@@ -89,5 +105,4 @@ class ValuePipe { | ||
* The ValuePipe parses derivable values in ontology objects and returns the literal value. When a state update occurs, the change | ||
detection is marked for check. It functions similarly to Angular's AsyncPipe and can be used in templates. | ||
\@param ref {ChangeDetectorRef} Angular change detection reference | ||
* @param {?} ref | ||
* detection is marked for check. It functions similarly to Angular's AsyncPipe and can be used in templates. | ||
* @param {?} ref {ChangeDetectorRef} Angular change detection reference | ||
*/ | ||
@@ -111,3 +126,3 @@ constructor(ref) { | ||
*/ | ||
this.strategy = undefined; | ||
this.strategy = /** @type {?} */ ((undefined)); | ||
} | ||
@@ -195,5 +210,3 @@ /** | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
/** @nocollapse */ | ||
ValuePipe.ctorParameters = () => [ | ||
@@ -203,2 +216,6 @@ { type: ChangeDetectorRef, }, | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
class NgxSherlockModule { | ||
@@ -216,11 +233,19 @@ } | ||
]; | ||
/** @nocollapse */ | ||
NgxSherlockModule.ctorParameters = () => []; | ||
/** | ||
* @nocollapse | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
NgxSherlockModule.ctorParameters = () => []; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* This function automatically detects changes when any `Derivable` or `DerivableProxy` in a consuming template changes state. | ||
\@param detector `ChangeDetectorRef` instance passed in by a consuming component. | ||
* @param {?} detector | ||
* Tries to detect changes. When that fails due to a template error, will detach the `ChangeDetectorRef` and rethrow | ||
* said error. | ||
* @param {?} detector `ChangeDetectorRef` instance passed in by a consuming component. | ||
* @return {?} | ||
@@ -232,3 +257,11 @@ */ | ||
} | ||
detector.onDestroy(derivation(() => detector.detectChanges()).react(() => void 0)); | ||
detector.onDestroy(derivation(() => { | ||
try { | ||
detector.detectChanges(); | ||
} | ||
catch (/** @type {?} */ error) { | ||
detector.detach(); | ||
throw error; | ||
} | ||
}).react(() => void 0)); | ||
} | ||
@@ -244,2 +277,21 @@ /** | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* Generated bundle index. Do not edit. | ||
@@ -246,0 +298,0 @@ */ |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@politie/sherlock'), require('@politie/informant')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@politie/sherlock', '@politie/informant'], factory) : | ||
(factory((global.ngxSherlock = global.ngxSherlock || {}),global.ng.core,global.politie.sherlock,global.politie.informant)); | ||
}(this, (function (exports,_angular_core,_politie_sherlock,_politie_informant) { 'use strict'; | ||
(factory((global.ngxSherlock = {}),global.ng.core,global.politie.sherlock,global.politie.informant)); | ||
}(this, (function (exports,core,sherlock,informant) { 'use strict'; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @record | ||
* @template T | ||
*/ | ||
/** | ||
* @param {?} obj | ||
@@ -26,2 +35,6 @@ * @return {?} | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* Error thrown when an invalid argument has been provided to a pipe. | ||
@@ -33,6 +46,4 @@ */ | ||
* Calls the super class BaseError with a helpful error message. | ||
\@param type Pipe that was provided with an invalid argument | ||
\@param value Invalid argument provided | ||
* @param {?} type | ||
* @param {?} value | ||
* @param type Pipe that was provided with an invalid argument | ||
* @param value Invalid argument provided | ||
*/ | ||
@@ -43,5 +54,14 @@ function InvalidPipeArgumentError(type, value) { | ||
return InvalidPipeArgumentError; | ||
}(_politie_informant.BaseError)); | ||
}(informant.BaseError)); | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* Base reaction strategy. | ||
* @record | ||
*/ | ||
/** | ||
* Reaction strategy for Derivable values. | ||
@@ -54,11 +74,23 @@ */ | ||
* Sets up the reaction. | ||
\@param async provided derivable | ||
\@param updateLatestValue function to run whenever a new value is emitted | ||
* | ||
* @param async provided derivable | ||
* @param updateLatestValue function to run whenever a new value is emitted | ||
*/ | ||
/** | ||
* Sets up the reaction. | ||
* | ||
* @template T | ||
* @param {?} async | ||
* @param {?} updateLatestValue | ||
* @param {?} async provided derivable | ||
* @param {?} updateLatestValue function to run whenever a new value is emitted | ||
* @return {?} | ||
*/ | ||
DerivableStrategy.prototype.createReaction = function (async, updateLatestValue) { | ||
DerivableStrategy.prototype.createReaction = /** | ||
* Sets up the reaction. | ||
* | ||
* @template T | ||
* @param {?} async provided derivable | ||
* @param {?} updateLatestValue function to run whenever a new value is emitted | ||
* @return {?} | ||
*/ | ||
function (async, updateLatestValue) { | ||
this.dispose = async.react(updateLatestValue); | ||
@@ -76,11 +108,23 @@ }; | ||
* Sets up the reaction. | ||
\@param async provided derivableProxy | ||
\@param updateLatestValue function to run whenever a new value is emitted | ||
* | ||
* @param async provided derivableProxy | ||
* @param updateLatestValue function to run whenever a new value is emitted | ||
*/ | ||
/** | ||
* Sets up the reaction. | ||
* | ||
* @template T | ||
* @param {?} async | ||
* @param {?} updateLatestValue | ||
* @param {?} async provided derivableProxy | ||
* @param {?} updateLatestValue function to run whenever a new value is emitted | ||
* @return {?} | ||
*/ | ||
DerivableProxyStrategy.prototype.createReaction = function (async, updateLatestValue) { | ||
DerivableProxyStrategy.prototype.createReaction = /** | ||
* Sets up the reaction. | ||
* | ||
* @template T | ||
* @param {?} async provided derivableProxy | ||
* @param {?} updateLatestValue function to run whenever a new value is emitted | ||
* @return {?} | ||
*/ | ||
function (async, updateLatestValue) { | ||
this.dispose = async.$react(updateLatestValue); | ||
@@ -92,13 +136,13 @@ }; | ||
* The {\@link ValuePipe} can be used to unwrap `Derivable` or `DerivableProxy` values in templates. Like Angular's | ||
[AsyncPipe]{\@link https://angular.io/api/common/AsyncPipe}, the | ||
[ChangeDetectorRef]{\@link https://angular.io/api/core/ChangeDetectorRef} of the `\@Host()` component will be `markedForCheck` whenever | ||
the provided value emits a new value. Usage is as follows: | ||
```html | ||
<!-- both title$ and someText$ are derivable values in MyComponent class --> | ||
<my-component | ||
[title]="title$ | value"> | ||
<p>{{someText$ | value}}</p> | ||
</my-component> | ||
``` | ||
* [AsyncPipe]{\@link https://angular.io/api/common/AsyncPipe}, the | ||
* [ChangeDetectorRef]{\@link https://angular.io/api/core/ChangeDetectorRef} of the `\@Host()` component will be `markedForCheck` whenever | ||
* the provided value emits a new value. Usage is as follows: | ||
* | ||
* ```html | ||
* <!-- both title$ and someText$ are derivable values in MyComponent class --> | ||
* <my-component | ||
* [title]="title$ | value"> | ||
* <p>{{someText$ | value}}</p> | ||
* </my-component> | ||
* ``` | ||
*/ | ||
@@ -108,5 +152,4 @@ var ValuePipe = /** @class */ (function () { | ||
* The ValuePipe parses derivable values in ontology objects and returns the literal value. When a state update occurs, the change | ||
detection is marked for check. It functions similarly to Angular's AsyncPipe and can be used in templates. | ||
\@param ref {ChangeDetectorRef} Angular change detection reference | ||
* @param {?} ref | ||
* detection is marked for check. It functions similarly to Angular's AsyncPipe and can be used in templates. | ||
* @param ref {ChangeDetectorRef} Angular change detection reference | ||
*/ | ||
@@ -130,9 +173,16 @@ function ValuePipe(ref) { | ||
*/ | ||
this.strategy = undefined; | ||
this.strategy = /** @type {?} */ ((undefined)); | ||
} | ||
/** | ||
* Called when `@Host()` component gets destroyed. | ||
*/ | ||
/** | ||
* Called when `\@Host()` component gets destroyed. | ||
* @return {?} | ||
*/ | ||
ValuePipe.prototype.ngOnDestroy = function () { | ||
ValuePipe.prototype.ngOnDestroy = /** | ||
* Called when `\@Host()` component gets destroyed. | ||
* @return {?} | ||
*/ | ||
function () { | ||
if (this.strategy) { | ||
@@ -147,3 +197,8 @@ this.dispose(); | ||
*/ | ||
ValuePipe.prototype.transform = function (obj) { | ||
ValuePipe.prototype.transform = /** | ||
* @template T | ||
* @param {?} obj | ||
* @return {?} | ||
*/ | ||
function (obj) { | ||
if (!this.storedObj) { | ||
@@ -164,3 +219,3 @@ if (obj) { | ||
this.latestReturnedValue = this.latestValue; | ||
return _angular_core.WrappedValue.wrap(this.latestValue); | ||
return core.WrappedValue.wrap(this.latestValue); | ||
}; | ||
@@ -172,3 +227,8 @@ /** | ||
*/ | ||
ValuePipe.prototype.subscribe = function (obj) { | ||
ValuePipe.prototype.subscribe = /** | ||
* @template T | ||
* @param {?} obj | ||
* @return {?} | ||
*/ | ||
function (obj) { | ||
var _this = this; | ||
@@ -184,7 +244,12 @@ this.storedObj = obj; | ||
*/ | ||
ValuePipe.prototype.selectStrategy = function (obj) { | ||
ValuePipe.prototype.selectStrategy = /** | ||
* @template T | ||
* @param {?} obj | ||
* @return {?} | ||
*/ | ||
function (obj) { | ||
if (isDerivableProxy(obj)) { | ||
return new DerivableProxyStrategy(); | ||
} | ||
else if (_politie_sherlock.isDerivable(obj)) { | ||
else if (sherlock.isDerivable(obj)) { | ||
return new DerivableStrategy(); | ||
@@ -201,3 +266,8 @@ } | ||
*/ | ||
ValuePipe.prototype.updateLatestValue = function (value) { | ||
ValuePipe.prototype.updateLatestValue = /** | ||
* @template T | ||
* @param {?} value | ||
* @return {?} | ||
*/ | ||
function (value) { | ||
this.latestValue = value; | ||
@@ -209,3 +279,6 @@ this.ref.markForCheck(); | ||
*/ | ||
ValuePipe.prototype.dispose = function () { | ||
ValuePipe.prototype.dispose = /** | ||
* @return {?} | ||
*/ | ||
function () { | ||
this.strategy.dispose(); | ||
@@ -218,9 +291,7 @@ this.latestValue = undefined; | ||
ValuePipe.decorators = [ | ||
{ type: _angular_core.Pipe, args: [{ name: 'value', pure: false },] }, | ||
{ type: core.Pipe, args: [{ name: 'value', pure: false },] }, | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
/** @nocollapse */ | ||
ValuePipe.ctorParameters = function () { return [ | ||
{ type: _angular_core.ChangeDetectorRef, }, | ||
{ type: core.ChangeDetectorRef, }, | ||
]; }; | ||
@@ -230,2 +301,6 @@ return ValuePipe; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
var NgxSherlockModule = /** @class */ (function () { | ||
@@ -235,3 +310,3 @@ function NgxSherlockModule() { | ||
NgxSherlockModule.decorators = [ | ||
{ type: _angular_core.NgModule, args: [{ | ||
{ type: core.NgModule, args: [{ | ||
declarations: [ | ||
@@ -245,5 +320,3 @@ ValuePipe, | ||
]; | ||
/** | ||
* @nocollapse | ||
*/ | ||
/** @nocollapse */ | ||
NgxSherlockModule.ctorParameters = function () { return []; }; | ||
@@ -254,5 +327,15 @@ return NgxSherlockModule; | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* This function automatically detects changes when any `Derivable` or `DerivableProxy` in a consuming template changes state. | ||
\@param detector `ChangeDetectorRef` instance passed in by a consuming component. | ||
* @param {?} detector | ||
* Tries to detect changes. When that fails due to a template error, will detach the `ChangeDetectorRef` and rethrow | ||
* said error. | ||
* @param {?} detector `ChangeDetectorRef` instance passed in by a consuming component. | ||
* @return {?} | ||
@@ -264,3 +347,11 @@ */ | ||
} | ||
detector.onDestroy(_politie_sherlock.derivation(function () { return detector.detectChanges(); }).react(function () { return void 0; })); | ||
detector.onDestroy(sherlock.derivation(function () { | ||
try { | ||
detector.detectChanges(); | ||
} | ||
catch (/** @type {?} */ error) { | ||
detector.detach(); | ||
throw error; | ||
} | ||
}).react(function () { return void 0; })); | ||
} | ||
@@ -276,2 +367,21 @@ /** | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* @fileoverview added by tsickle | ||
* @suppress {checkTypes} checked by tsc | ||
*/ | ||
/** | ||
* Generated bundle index. Do not edit. | ||
@@ -278,0 +388,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@politie/sherlock"),require("@politie/informant")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@politie/sherlock","@politie/informant"],e):e(t.ngxSherlock=t.ngxSherlock||{},t.ng.core,t.politie.sherlock,t.politie.informant)}(this,function(t,e,r,o){"use strict";function n(t){return t.$react&&"function"==typeof t.$react}var i=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),s=function(t){function e(e,r){return t.call(this,{type:e,value:r},"Invalid PipeArgument for pipe "+e.name)||this}return i(e,t),e}(o.BaseError),a=function(){function t(){}return t.prototype.createReaction=function(t,e){this.dispose=t.react(e)},t}(),u=function(){function t(){}return t.prototype.createReaction=function(t,e){this.dispose=t.$react(e)},t}(),c=function(){function t(t){this.ref=t,this.latestValue=void 0,this.latestReturnedValue=void 0,this.storedObj=void 0,this.strategy=void 0}return t.prototype.ngOnDestroy=function(){this.strategy&&this.dispose()},t.prototype.transform=function(t){return this.storedObj?t!==this.storedObj?(this.dispose(),this.transform(t)):this.latestValue===this.latestReturnedValue?this.latestReturnedValue:(this.latestReturnedValue=this.latestValue,e.WrappedValue.wrap(this.latestValue)):(t&&this.subscribe(t),this.latestReturnedValue=this.latestValue,this.latestValue)},t.prototype.subscribe=function(t){var e=this;this.storedObj=t,this.strategy=this.selectStrategy(t),this.strategy.createReaction(t,function(t){return e.updateLatestValue(t)})},t.prototype.selectStrategy=function(e){if(n(e))return new u;if(r.isDerivable(e))return new a;throw new s(t,e)},t.prototype.updateLatestValue=function(t){this.latestValue=t,this.ref.markForCheck()},t.prototype.dispose=function(){this.strategy.dispose(),this.latestValue=void 0,this.latestReturnedValue=void 0,this.storedObj=void 0,this.strategy=void 0},t.decorators=[{type:e.Pipe,args:[{name:"value",pure:!1}]}],t.ctorParameters=function(){return[{type:e.ChangeDetectorRef}]},t}(),l=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[c],exports:[c]}]}],t.ctorParameters=function(){return[]},t}();t.NgxSherlockModule=l,t.DerivableStrategy=a,t.DerivableProxyStrategy=u,t.ValuePipe=c,t.InvalidPipeArgumentError=s,t.autoDetectChanges=function(t){if(!t||"function"!=typeof t.onDestroy)throw new Error("autoDetectChanges was not called with a valid ChangeDetectorRef.");t.onDestroy(r.derivation(function(){return t.detectChanges()}).react(function(){}))},t.isDerivableProxy=n,t.ɵa=c,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@politie/sherlock"),require("@politie/informant")):"function"==typeof define&&define.amd?define(["exports","@angular/core","@politie/sherlock","@politie/informant"],e):e(t.ngxSherlock={},t.ng.core,t.politie.sherlock,t.politie.informant)}(this,function(t,e,r,o){"use strict";function i(t){return t.$react&&"function"==typeof t.$react}var n=function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),s=function(t){function e(e,r){return t.call(this,{type:e,value:r},"Invalid PipeArgument for pipe "+e.name)||this}return n(e,t),e}(o.BaseError),a=function(){function t(){}return t.prototype.createReaction=function(t,e){this.dispose=t.react(e)},t}(),u=function(){function t(){}return t.prototype.createReaction=function(t,e){this.dispose=t.$react(e)},t}(),c=function(){function t(t){this.ref=t,this.latestValue=void 0,this.latestReturnedValue=void 0,this.storedObj=void 0,this.strategy=void 0}return t.prototype.ngOnDestroy=function(){this.strategy&&this.dispose()},t.prototype.transform=function(t){return this.storedObj?t!==this.storedObj?(this.dispose(),this.transform(t)):this.latestValue===this.latestReturnedValue?this.latestReturnedValue:(this.latestReturnedValue=this.latestValue,e.WrappedValue.wrap(this.latestValue)):(t&&this.subscribe(t),this.latestReturnedValue=this.latestValue,this.latestValue)},t.prototype.subscribe=function(t){var e=this;this.storedObj=t,this.strategy=this.selectStrategy(t),this.strategy.createReaction(t,function(t){return e.updateLatestValue(t)})},t.prototype.selectStrategy=function(e){if(i(e))return new u;if(r.isDerivable(e))return new a;throw new s(t,e)},t.prototype.updateLatestValue=function(t){this.latestValue=t,this.ref.markForCheck()},t.prototype.dispose=function(){this.strategy.dispose(),this.latestValue=void 0,this.latestReturnedValue=void 0,this.storedObj=void 0,this.strategy=void 0},t.decorators=[{type:e.Pipe,args:[{name:"value",pure:!1}]}],t.ctorParameters=function(){return[{type:e.ChangeDetectorRef}]},t}(),l=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[c],exports:[c]}]}],t.ctorParameters=function(){return[]},t}();t.NgxSherlockModule=l,t.DerivableStrategy=a,t.DerivableProxyStrategy=u,t.ValuePipe=c,t.InvalidPipeArgumentError=s,t.autoDetectChanges=function(t){if(!t||"function"!=typeof t.onDestroy)throw new Error("autoDetectChanges was not called with a valid ChangeDetectorRef.");t.onDestroy(r.derivation(function(){try{t.detectChanges()}catch(e){throw t.detach(),e}}).react(function(){}))},t.isDerivableProxy=i,t.ɵa=c,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=ngx-sherlock.umd.min.js.map |
import { ChangeDetectorRef } from '@angular/core'; | ||
/** | ||
* This function automatically detects changes when any `Derivable` or `DerivableProxy` in a consuming template changes state. | ||
* Tries to detect changes. When that fails due to a template error, will detach the `ChangeDetectorRef` and rethrow | ||
* said error. | ||
* @param detector `ChangeDetectorRef` instance passed in by a consuming component. | ||
*/ | ||
export declare function autoDetectChanges(detector: ChangeDetectorRef): void; |
@@ -1,1 +0,1 @@ | ||
{"__symbolic":"module","version":3,"exports":[{"from":"./types"}],"metadata":{"NgxSherlockModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ɵa"}],"exports":[{"__symbolic":"reference","name":"ɵa"}]}]}],"members":{}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Pipe"},"arguments":[{"name":"value","pure":false}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef"}]}],"ngOnDestroy":[{"__symbolic":"method"}],"transform":[{"__symbolic":"method"}],"subscribe":[{"__symbolic":"method"}],"selectStrategy":[{"__symbolic":"method"}],"updateLatestValue":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}]}}},"origins":{"NgxSherlockModule":"./ngx-sherlock.module","ɵa":"./pipes/value.pipe"},"importAs":"@politie/ngx-sherlock"} | ||
{"__symbolic":"module","version":4,"exports":[{"from":"./types"}],"metadata":{"NgxSherlockModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":3,"character":1},"arguments":[{"declarations":[{"__symbolic":"reference","name":"ɵa"}],"exports":[{"__symbolic":"reference","name":"ɵa"}]}]}],"members":{}},"ɵa":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Pipe","line":67,"character":1},"arguments":[{"name":"value","pure":false}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":84,"character":31}]}],"ngOnDestroy":[{"__symbolic":"method"}],"transform":[{"__symbolic":"method"}],"subscribe":[{"__symbolic":"method"}],"selectStrategy":[{"__symbolic":"method"}],"updateLatestValue":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}]}}},"origins":{"NgxSherlockModule":"./ngx-sherlock.module","ɵa":"./pipes/value.pipe"},"importAs":"@politie/ngx-sherlock"} |
109
package.json
{ | ||
"name": "@politie/ngx-sherlock", | ||
"version": "1.0.0-beta.7", | ||
"description": "NgxSherlock is a library with angular bindings for the Sherlock reactive state library.", | ||
"version": "1.0.0-beta.10", | ||
"description": "NgxSherlock is a library with angular bindings for the Sherlock reacive state library.", | ||
"private": false, | ||
@@ -10,3 +10,3 @@ "main": "./bundles/ngx-sherlock.umd.js", | ||
"test": "node ./tasks/test", | ||
"build": "npm run test && node ./tasks/build", | ||
"build": "node ./tasks/build", | ||
"g": "node ./node_modules/angular-librarian", | ||
@@ -16,12 +16,7 @@ "lint": "tslint ./src/**/*.ts", | ||
"posttagVersion": "npm run build && npm publish dist", | ||
"prebuild": "rimraf dist out-tsc", | ||
"prebuild": "rimraf dist out-tsc && npm run test", | ||
"start": "webpack-dev-server --open --config ./webpack/webpack.dev.js", | ||
"tagVersion": "np --no-publish", | ||
"ci:travis": "npm run build && npm run integration && cat coverage/lcov.info | node_modules/.bin/coveralls", | ||
"ci:circle": "npm run build && npm run integration", | ||
"integration": "npm-run-all -s integration:*", | ||
"integration:pack": "cd dist && npm pack", | ||
"integration:prepare": "rimraf integration/node_modules && mv dist/*.tgz integration/politie-ngx-sherlock.tgz", | ||
"integration:install": "cd integration && rimraf package-lock.json && npm i && npm i ./politie-ngx-sherlock.tgz", | ||
"integration:test": "cd integration && npm run test" | ||
"tagVersion": "node ./tasks/tag-version", | ||
"ci:travis": "npm run build && cat coverage/lcov.info | node_modules/.bin/coveralls", | ||
"ci:circle": "npm run build" | ||
}, | ||
@@ -54,51 +49,53 @@ "repository": { | ||
"devDependencies": { | ||
"@angular/compiler-cli": "^4.0.0", | ||
"@politie/sherlock-proxy": "^1.0.0-beta.0", | ||
"@types/jasmine": "2.5.38", | ||
"@types/node": "^6.0.42", | ||
"angular-librarian": "1.0.0-beta.14", | ||
"@angular/compiler-cli": "^5.0.0", | ||
"@politie/sherlock-proxy": "^1.0.0-beta.4", | ||
"@types/jasmine": "^2.8.6", | ||
"@types/node": "^8.0.0", | ||
"angular-librarian": "1.0.0", | ||
"angular2-template-loader": "0.6.0", | ||
"awesome-typescript-loader": "^3.0.0", | ||
"codelyzer": "~3.0.0", | ||
"awesome-typescript-loader": "^3.5.0", | ||
"codelyzer": "^4.0.0", | ||
"coveralls": "^3.0.0", | ||
"css-loader": "^0.26.1", | ||
"css-to-string-loader": "^0.1.3", | ||
"extract-text-webpack-plugin": "^2.1.0", | ||
"file-loader": "^0.8.5", | ||
"css-loader": "^0.28.0", | ||
"css-to-string-loader": "^0.1.0", | ||
"extract-text-webpack-plugin": "^3.0.0", | ||
"file-loader": "^1.0.0", | ||
"fs-extra": "^2.1.2", | ||
"html-webpack-plugin": "^2.19.0", | ||
"html-webpack-plugin": "^2.0.0", | ||
"immutable": "^3.8.2", | ||
"istanbul-instrumenter-loader": "^1.2.0", | ||
"jasmine-core": "2.5.2", | ||
"jasmine-spec-reporter": "2.5.0", | ||
"karma": "1.2.0", | ||
"istanbul-instrumenter-loader": "^3.0.0", | ||
"jasmine-core": "^2.99.1", | ||
"jasmine-spec-reporter": "^4.0.0", | ||
"karma": "^1.7.1", | ||
"karma-chrome-launcher": "^2.0.0", | ||
"karma-coverage-istanbul-reporter": "^1.3.0", | ||
"karma-jasmine": "^1.0.2", | ||
"karma-coverage-istanbul-reporter": "^1.4.1", | ||
"karma-jasmine": "^1.1.1", | ||
"karma-phantomjs-launcher": "^1.0.2", | ||
"karma-sourcemap-loader": "^0.3.7", | ||
"karma-webpack": "^2.0.0", | ||
"node-sass": "^4.1.1", | ||
"np": "^2.12.0", | ||
"npm-run-all": "^4.1.2", | ||
"karma-webpack": "^2.0.13", | ||
"node-sass": "^4.7.2", | ||
"np": "^2.20.1", | ||
"phantomjs-prebuilt": "^2.1.7", | ||
"raw-loader": "^0.5.1", | ||
"rimraf": "^2.5.3", | ||
"rollup": "0.43.0", | ||
"rollup-plugin-commonjs": "^8.0.2", | ||
"rollup": "0.52.1", | ||
"rollup-plugin-commonjs": "^8.4.1", | ||
"rollup-plugin-node-builtins": "^2.1.2", | ||
"rollup-plugin-node-globals": "^1.1.0", | ||
"rollup-plugin-node-resolve": "3.0.0", | ||
"rollup-plugin-sourcemaps": "0.4.2", | ||
"rollup-plugin-uglify": "2.0.1", | ||
"sass-loader": "^4.0.1", | ||
"sass-loader": "^6.0.0", | ||
"script-loader": "^0.7.0", | ||
"semver": "5.3.0", | ||
"semver": "^5.5.0", | ||
"shx": "^0.2.2", | ||
"source-map-loader": "^0.1.5", | ||
"style-loader": "^0.13.1", | ||
"tslint": "^5.0.0", | ||
"tslint-loader": "^3.0.0", | ||
"typescript": "^2.6.2", | ||
"source-map-loader": "^0.2.0", | ||
"style-loader": "^0.19.0", | ||
"tslint": "^5.9.1", | ||
"tslint-loader": "^3.6.0", | ||
"typescript": "~2.7.2", | ||
"typings": "^0.8.1", | ||
"url-loader": "^0.5.7", | ||
"webpack": "^2.2.0", | ||
"webpack-dev-server": "^2.2.0", | ||
"url-loader": "^0.6.2", | ||
"webpack": "^3.0.0", | ||
"webpack-dev-server": "^2.11.2", | ||
"webpack-merge": "^0.14.0", | ||
@@ -111,13 +108,13 @@ "webpack-node-externals": "^1.5.4" | ||
"peerDependencies": { | ||
"@angular/common": "^4.0.0", | ||
"@angular/compiler": "^4.0.0", | ||
"@angular/core": "^4.0.0", | ||
"@angular/platform-browser": "^4.0.0", | ||
"@angular/platform-browser-dynamic": "^4.0.0", | ||
"@politie/informant": "^1.0.0-beta.3", | ||
"@politie/sherlock": "^1.0.0-beta.2", | ||
"core-js": "^2.4.1", | ||
"rxjs": "^5.0.1", | ||
"zone.js": "0.8.12" | ||
"@angular/common": "^5.0.0", | ||
"@angular/compiler": "^5.0.0", | ||
"@angular/core": "^5.0.0", | ||
"@angular/platform-browser": "^5.0.0", | ||
"@angular/platform-browser-dynamic": "^5.0.0", | ||
"@politie/informant": "^1.0.0-beta.5", | ||
"@politie/sherlock": "^1.0.0-beta.4", | ||
"core-js": "^2.5.3", | ||
"rxjs": "^5.5.6", | ||
"zone.js": "^0.8.14" | ||
} | ||
} |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
88467
1133
0
53