@craftworks/craftworks-library-rxjs
A RxJS library used at craftworks
Installation
npm install --save @craftworks/craftworks-library-rxjs
peerDependencies
- rxjs ^6.6.3 | ^7.0.0
API
/**
* Logs the current value to the console on .next, .error and .complete
*
* @param {string} [tag] - A optional tag, if no tag is supplied a incrementing index is used
*/
function debug<T>(tag?: string | undefined): MonoTypeOperatorFunction<T>
/**
* Sets the status of the loadingStore$ to true
* Use this when loading should be started
*
* @param {Subject<boolean>} loadingStore$ - store to set `isLoading` state
* @param {boolean} [omitError=false] - whether to set loadingStore and loadedStore when an error occurs, defaults to false
*/
function loadingStart<T>(loadingStore$: Subject<boolean>, omitError?: boolean): MonoTypeOperatorFunction<T>;
/**
* Sets the status of the loadingStore$ to false
* Use this when loading should be stopped
*
* @param {Subject<boolean>} loadingStore$ - store to set `isLoading` state
* @param {Subject<boolean>} [loadedStore$] - optional store to set `hasLoaded` state
* @param {boolean} [omitError=false] - whether to set loadingStore and loadedStore when an error occurs, defaults to false
*/
function loadingStop<T>(loadingStore$: Subject<boolean>, loadedStore$?: Subject<boolean>, omitError?: boolean): MonoTypeOperatorFunction<T>;
/**
* Sets the status of the loadingStore$ to true via an imperative call
* Use this when loading should be stopped in a imperative manner (e.g. before calling a observable)
*
* @param {Subject<boolean>} loadingStore$ - store to set `isLoading` state
*/
function loadingStartStatic(loadingStore$: Subject<boolean>): void;
/**
* Sets the status of the loadingStore$ to false via an imperative call
* Use this when loading should be stopped in a imperative manner (e.g. externally stopping)
*
* @param {Subject<boolean>} loadingStore$ - store to set `isLoading` state
* @param {Subject<boolean>} [loadedStore$] - optional store to set `hasLoaded` state
*/
function loadingStopStatic(loadingStore$: Subject<boolean>, loadedStore$?: Subject<boolean>): void;