Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View neotericneoteny's full-sized avatar

Matthew Zimmer neotericneoteny

View GitHub Profile
@neotericneoteny
neotericneoteny / StorageManager.js
Last active April 24, 2018 10:41
StorageManager makes it super trivial to persist and retrieve arbitrary structured data for front-end HTML web applications. It is essentially a glorified wrapper class for the W3C Web Storage specification.
/**
* An adaptable cache manager class used to persist one or more arbitrary objects client-side. The default caching
* strategy is WEB_STORAGE. In the event WEB_STORAGE is unavailable (i.e., in older web browsers like IE6), the
* backup strategy, COOKIE_STORAGE, is used with one minor catch detailed next.
*
* COOKIE_STORAGE will only work when the jquery.cookie.js plugin is available in the jQuery plugin path. This decision was made
* in an effort to simplify this class' source and because it just didn't make sense to reinvent the wheel.
*
* For usage instructions, please see the comments above the class definition.
*