Skip to main content
Module

x/args/deps.ts>once

Extensible CLI arguments parser for Deno with intelligent TypeScript inference
Go to Latest
function once
import { once } from "https://deno.land/x/args@1.0.0/deps.ts";

Create a function that calls and cache a function once

Examples

import once from 'https://ksxgithub.github.io/deno-once/index.js' const ran = once(Math.random) console.log(ran() === ran()) // => true

Parameters

fn: () => Return

Function to be invoked once

Returns

() => Return

Function that returns result of first-time execution of fn