All Downloads are FREE. Search and download functionalities are using the official Maven repository.

utils.cacher.js Maven / Gradle / Ivy

There is a newer version: 7.28.3
Show newest version
const cachingStore = () => {
    const cache = {}

    return {
        add(params, result) {
            cache[JSON.stringify(params)] = result
        },

        find(params) {
            const key = JSON.stringify(params)

            // eslint-disable-next-line no-prototype-builtins
            if (cache.hasOwnProperty(key)) {
                return cache[key]
            }

            return false
        },
    }
}

export default cachingStore()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy