Skip to main content
Module

x/denops_std/lambda/mod.ts>Lambda

📚 Standard module for denops.vim
Go to Latest
interface Lambda
import { type Lambda } from "https://deno.land/x/denops_std@v6.2.0/lambda/mod.ts";

Methods

notify(...args: unknown[]): string

Create a Vim script expression to notify the lambda function

import type { Denops } from "https://deno.land/x/denops_std@v6.2.0/mod.ts";
import * as lambda from "https://deno.land/x/denops_std@v6.2.0/lambda/mod.ts";

export async function main(denops: Denops): Promise<void> {
  const a = lambda.add(denops, () => {
    // Do what ever you want.
  });
  await denops.cmd(`nmap <Space> <Cmd>call ${a.notify()}<CR>`);
}
request(...args: unknown[]): string

Create a Vim script expression to request the lambda function

import type { Denops } from "https://deno.land/x/denops_std@v6.2.0/mod.ts";
import * as lambda from "https://deno.land/x/denops_std@v6.2.0/lambda/mod.ts";

export async function main(denops: Denops): Promise<void> {
  const a = lambda.add(denops, () => {
    // Do what ever you want.
  });
  await denops.cmd(`nmap <Space> <Cmd>call ${a.request()}<CR>`);
}
dispose(): void

Dispose the lambda function

import type { Denops } from "https://deno.land/x/denops_std@v6.2.0/mod.ts";
import * as lambda from "https://deno.land/x/denops_std@v6.2.0/lambda/mod.ts";

export async function main(denops: Denops): Promise<void> {
  const a = lambda.add(denops, () => {
    // Do what ever you want.
  });
 // Dispose the lambda function manually
 a.dispose();
}
[[Symbol.dispose]](): void