reactive-actor
Version:
Actor model implementation with rxjs
16 lines (15 loc) • 573 B
TypeScript
import { MonoTypeOperatorFunction } from 'rxjs';
import { PredicateFunction } from '../types';
export interface ValidateParams<T> {
validation: PredicateFunction<T>;
error?: string;
}
/**
* Validates the source emitted value, throws an error when validation
* doesn't pass
* @param params -
* - validation: predicate function to test emitted value
* - error: message in case of error
* @returns an operator function that validates emitted values
*/
export declare function validate<T>({ validation, error, }: ValidateParams<T>): MonoTypeOperatorFunction<T>;