Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "promise/never"

Index

Variables

Functions

Variables

Const NEVER

NEVER: Promise<any> = new Promise<any>(noop)

A promise which never resolves

Example:

import { NEVER } from '@thalesrc/js-utils/promise';

function foo(promise = NEVER) {
  promise.then(val => {
    ...
  });
}

Functions

never

  • never<T>(): Promise<T>
  • Creates a promise which never resolves

    Example:

    import { never } from '@thalesrc/js-utils/promise';
    
    function foo(promise) {
      promise = promise || never();
    
      promise.then(val => {
        ...
      });
    }

    Type parameters

    • T

    Returns Promise<T>

    the promise which never resolves

Generated using TypeDoc