Options
All
  • Public
  • Public/Protected
  • All
Menu

Once is once manage class

Hierarchy

  • Once

Index

Methods

Methods

delete

  • delete(key: string): void
  • delete remove cache by group key

    Parameters

    • key: string

      cache group key

    Returns void

once

  • once<T>(key: string, f: func<T>, force?: boolean): Promise<T>
  • once calls the function f if and only if once is being called for the first time for this instance of Once.

    Type parameters

    • T

    Parameters

    • key: string

      cache group key, should be unique

    • f: func<T>

      func to be invoked for the first time

    • Default value force: boolean = false

      if set true, will force invoke f and update cache

    Returns Promise<T>

syncOnce

  • syncOnce<T>(key: string, f: syncFunc<T>, force?: boolean): T
  • sync version of once

    Type parameters

    • T

    Parameters

    • key: string

      cache group key, should be unique

    • f: syncFunc<T>

      func to be invoked for the first time

    • Default value force: boolean = false

      if set true, will force invoke f and update cache

    Returns T

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc