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

x/denops_std/lambda/mod.ts>Lambda

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

Methods

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

Create a Vim script expression to notify the lambda function

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

export const main: Entrypoint = async (denops) => {
  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 { Entrypoint } from "https://deno.land/x/denops_std@v6.5.0/mod.ts";
import * as lambda from "https://deno.land/x/denops_std@v6.5.0/lambda/mod.ts";

export const main: Entrypoint = async (denops) => {
  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 { Entrypoint } from "https://deno.land/x/denops_std@v6.5.0/mod.ts";
import * as lambda from "https://deno.land/x/denops_std@v6.5.0/lambda/mod.ts";

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