Skip to main content
Module

x/grammy_conversations/utils.ts>Resolver

Conversational interfaces for grammY
Go to Latest
interface Resolver
import { type Resolver } from "https://deno.land/x/grammy_conversations@v1.1.0/utils.ts";

A resolver wraps a promise so that it can be resolved by an outside event. It is a container for this promise which you can await, and a function resolve which you can call. Once you call resolve, the contained promise will resolve.

The status flag isResolved indicates if resolve has been called or not.

Properties

promise: Promise<T>

The promise which can be resolved by calling resolve

optional
value: T

Value of the promise, if is it resolved, and undefined otherwise

Methods

resolve(t?: T): void

Resolves the promise of this resolver

isResolved(): this is { value: T; }

A flag indicating whether resolve has been called, i.e. whether the promise has been resolved. Has the value true until resolve is called.