Deprecated
Use lambda.unregister()
function instead.
import { remove } from "https://deno.land/x/denops_std@v4.0.0/anonymous/mod.ts";
Remove anonymous functions from denops API identified by the identifiers
import { Denops } from "../mod.ts";
import * as anonymous from "./mod.ts";
export async function main(denops: Denops): Promise<void> {
// Add anonymous functions
const ids = anonymous.add(
denops,
() => {
// Do what ever you want.
},
() => {
// Do what ever you want.
},
// You can add as many callbacks as you want...
);
// Remove ids[1]
anonymous.remove(denops, ids[1]);
// Call of ids[0] complete normally
await denops.dispatch(denops.name, ids[0]);
// But ids[1] is already removed
await denops.dispatch(denops.name, ids[1]);
}
Parameters
denops: Denops
...ids: Identifier[] & { length: N; }