Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* When `true` the derivable will not update the first time it receives an update from the parent derivable. After that it has no effect.
*/
skipFirst?: boolean;
/*
* Indicates whether an update to unresolved state is considered an update. Default: false.
*/
includeUnresolved?: boolean;
}
// tslint:disable-next-line:ban-types
type PreparedOptions = { [P in keyof ControlFlowOptions]?: Exclude[P], Function> };
class ControlFlow extends _internal.BaseDerivable implements Derivable {
private readonly opts: PreparedOptions;
constructor(
private readonly base: Derivable,
opts?: ControlFlowOptions,
) {
super();
this.opts = prepareOptions(base, opts);
}
/**
* The last state that was calculated for this derivable. Is only used when connected.
* @internal
*/
private _currentState: State = unresolved;