Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ddc_vim/deps.ts>deadline

Dark deno-powered completion framework for neovim/Vim8
Very Popular
Go to Latest
function deadline
import { deadline } from "https://deno.land/x/ddc_vim@v3.4.0/deps.ts";

Create a promise which will be rejected with DeadlineError when a given delay is exceeded.

Examples

Example 1

import { deadline } from "https://deno.land/std@0.224.0/async/deadline.ts";
import { delay } from "https://deno.land/std@0.224.0/async/delay.ts";

const delayedPromise = delay(1000);
// Below throws `DeadlineError` after 10 ms
const result = await deadline(delayedPromise, 10);

Parameters

p: Promise<T>
delay: number

Returns

Promise<T>