Implement basic login & registration forms
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -8,7 +8,7 @@ export type PipeOperator<T, T2> = (subject: T) => T2
|
||||
/**
|
||||
* A closure that maps a given pipe item to an item of the same type.
|
||||
*/
|
||||
export type ReflexivePipeOperator<T> = (subject: T) => T|void
|
||||
export type ReflexivePipeOperator<T> = (subject: T) => T
|
||||
|
||||
/**
|
||||
* A condition or condition-resolving function for pipe methods.
|
||||
@@ -97,7 +97,7 @@ export class Pipe<T> {
|
||||
*/
|
||||
when(check: PipeCondition<T>, op: ReflexivePipeOperator<T>): Pipe<T> {
|
||||
if ( (typeof check === 'function' && check(this.subject)) || check ) {
|
||||
Pipe.wrap(op(this.subject))
|
||||
return Pipe.wrap(op(this.subject))
|
||||
}
|
||||
|
||||
return this
|
||||
@@ -115,8 +115,7 @@ export class Pipe<T> {
|
||||
return this
|
||||
}
|
||||
|
||||
Pipe.wrap(op(this.subject))
|
||||
return this
|
||||
return Pipe.wrap(op(this.subject))
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -52,12 +52,14 @@ export function withTimeout<T>(timeout: number, promise: Promise<T>): TimeoutSub
|
||||
run: async () => {
|
||||
let expired = false
|
||||
let resolved = false
|
||||
setTimeout(() => {
|
||||
expired = true
|
||||
if ( !resolved ) {
|
||||
timeoutHandler()
|
||||
}
|
||||
}, timeout)
|
||||
if ( timeout ) {
|
||||
setTimeout(() => {
|
||||
expired = true
|
||||
if ( !resolved ) {
|
||||
timeoutHandler()
|
||||
}
|
||||
}, timeout)
|
||||
}
|
||||
|
||||
const result: T = await promise
|
||||
resolved = true
|
||||
|
||||
Reference in New Issue
Block a user