A Map sub-class backed by a persistant store
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/31448/206062/data-cachejs.js
For playing with in DevTools.
c = ((key, data) => {
function getter() { console.info('getter(): %o', data); return data }
function setter(value) { console.info('setter(%o)', value); data = value }
return new DataCache({ getter, setter, debug: true })
})('test', { name: 'bob', items: ['foo', 'bar'] })
const cache = new DataCache({
getter: GM_getValue,
setter: GM_setValue,
key: 'repos'
})
cache.set('favourites', [ 'json-schema-faker/json-schema-faker', 'angular/angular', 'jquery/jquery' ])