Options
All
  • Public
  • Public/Protected
  • All
Menu

Module function/memoize/createCache

Index

References

Functions

References

Renames and re-exports createCache

Functions

  • createCache(obj?: any): { get: any; has: any; set: any }
  • Creates a cache instance base on passed object. Return instance has 3 methods: get, set, has

    example
     const cache = createCache();
    cache.set('a', 5);
    cache.has('a'); // true
    cache.get('a'); // 5

    Parameters

    • obj: any = ...

      object that will be used as cache

    Returns { get: any; has: any; set: any }

    • get:function
      • get(key: any): any
      • Parameters

        • key: any

        Returns any

    • has:function
      • has(key: any): boolean
      • Parameters

        • key: any

        Returns boolean

    • set:function
      • set(key: any, value: any): any
      • Parameters

        • key: any
        • value: any

        Returns any

Generated using TypeDoc