stash-it
  • stash-it
  • Installation
  • Changelog
  • Item
  • Adapters
    • Available adapters
    • Writing adapters
  • Lifecycle of methods
  • Plugins
    • hooks
    • createExtensions
    • Writing plugins
    • Available plugins
  • API
    • stash-it
      • createCache(adapter)
      • createItem(key, value, [extra])
      • getPreData(methodName, args)
      • getPostData(methodName, args)
    • cacheInstance
      • addHook(hook)
      • addHooks(hooks)
      • getHooks()
      • buildKey(key)
      • getItem(key)
      • getExtra(key)
      • addExtra(key, extra)
      • setExtra(key, extra)
      • setItem(key, value, [extra])
      • hasItem(key)
      • removeItem(key)
      • registerPlugins(plugins)
    • Adapter
      • buildKey(key)
      • getItem(key)
      • getExtra(key)
      • addExtra(key, extra)
      • setExtra(key, extra)
      • setItem(key, value, [extra])
      • hasItem(key)
      • removeItem(key)
Powered by GitBook
On this page
  • Arguments
  • Returns
  • Example
  1. API
  2. Adapter

hasItem(key)

Checks if items exists.

Arguments

  1. key (string): A string to find an item under.

Returns

(bool): true if item is found, false otherwise.

Example

// `result` will equal either `true` or `false` - depending if items exists or not
const result = adapter.hasItem('key');
PrevioussetItem(key, value, [extra])NextremoveItem(key)

Last updated 6 years ago