Function getCache

  • Get the cache, if the deposited is Object, the retrieved is also Object, no need to convert again

    Parameters

    • name: string

      cache name

    Returns any

    • data, if it's an object, it's also an object
    const data1 = 100
    const data2 = { a: 10 }
    const data3 = null

    setCache('data1', data1)
    setCache('data2', data2)
    setCache('data3', data3)

    getCache('data1') // 100
    getCache('data2') // {a:10}
    getCache('data3') // null

    getCache('data4') // null

    1.0.2