Options
All
  • Public
  • Public/Protected
  • All
Menu

waitfor.ts

Index

Classes

Interfaces

Type aliases

Functions

Type aliases

Resolver

Resolver: function

Type declaration

    • (context?: any): boolean
    • Parameters

      • Optional context: any

      Returns boolean

Functions

decorator

  • decorator(resolverFn: function, options?: WaitForOptions): (Anonymous function)
  • Typescript method decorator that wraps the WaitFor class.

    import { WaitFor } from 'waitfor.ts';
    
    let logit = false;
    
    function resolver() {
     setTimeout(() => logit = true, 500);
    }
    
    class SomeCoolThing {
     @WaitFor(resolver);
     public imPatient(): string {
       console.log('It took about half a second, but i have arrived');
     }
    }
    
    // in your implementation
    new SomeCoolThing().imPatient(); // will log after 500ms

    Parameters

    • resolverFn: function
        • (context: any): boolean
        • Parameters

          • context: any

          Returns boolean

    • Default value options: WaitForOptions = {timeout: 1000}

    Returns (Anonymous function)

Generated using TypeDoc