Classes for your scripts
이 스크립트는 직접 설치하는 용도가 아닙니다. 다른 스크립트에서 메타 지시문 // @require https://update.greasyfork.org/scripts/389765/1090053/CommonUtils.js을(를) 사용하여 포함하는 라이브러리입니다.
// @require https://greasyfork.org/scripts/389765-common-utils/code/CommonUtils.js?version=XXX
See last available version on the GreasyFork homepage
let CacheInstance = new SimpleCache();
let result = null;
if (CacheInstance.has('key')) {
result = CacheInstance.get('key');
} else {
result = await $.ajax('url');
CacheInstance.set('key', result);
}
let SettingsInstance = new Settings('script name', {'default':'settings'});
With jQuery:
$(window).on('beforeunload', () => SettingsInstance.save() );
Author homepage: http://anton.shevchuk.name/
Script homepage: https://github.com/AntonShevchuk/common.utils
GreasyFork: https://greasyfork.org/uk/scripts/389765-common-utils