Skip to content

AntonShevchuk/common.utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Common Utils

Require Script

// @require https://greasyfork.org/scripts/389765-common-utils/code/CommonUtils.js?version=XXX

See last available version on the GreasyFork homepage

Container

Cache

let CacheInstance = new SimpleCache();
let result = null;
if (CacheInstance.has('key')) {
  result = CacheInstance.get('key');
} else {
  result = await $.ajax('url');
  CacheInstance.set('key', result);
}

Settings

Load settings

let SettingsInstance = new Settings('script name', {'default':'settings'});

Save settings

With jQuery:

$(window).on('beforeunload', () => SettingsInstance.save() );

Links

Author homepage: http://anton.shevchuk.name/
Script homepage: https://github.com/AntonShevchuk/common.utils
GreasyFork: https://greasyfork.org/uk/scripts/389765-common-utils

About

GreasyFork common utils

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published