Improved persistent local storage based on library LocalForage:


https://localforage.github.io/localForage/


localForage is a JavaScript library that improves the offline experience of your web app by using an asynchronous data store with a simple, localStorage-like API. It allows developers to store many types of data instead of just strings.


localForage includes a localStorage-backed fallback store for browsers with no IndexedDB or WebSQL support. Asynchronous storage is available in the current versions of all major browsers: Chrome, Firefox, IE, and Safari (including Safari Mobile).


Description


The neoLocalStorage plugin for VisualNEO Web provides a simple, flexible way to store and retrieve data persistently on the client side. Based on the localForage library, it enhances the offline experience by supporting various data types, including strings, numbers, arrays, and JSON objects. This plugin is especially useful for applications that need to save user preferences, maintain session states, or cache data for offline use. Here’s a breakdown of its main functionalities and practical applications:

Data Storage and Retrieval: Using neoSetItem and neoGetItem, developers can save data persistently in local storage and retrieve it as needed. This is useful for storing settings, user preferences, and data that the app may need to access frequently.

Data Management and Cleanup: The plugin provides commands for removing specific items or clearing all stored data, which can be helpful for resetting settings or clearing cache.

    • Commands:
      • neoRemoveItem: Removes a specific item by key.
      • neoClearItems: Clears all stored data in local storage.

Additional Utilities: The plugin includes several utility commands:

    • neoGetItemsLength: Retrieves the number of items stored, useful for managing storage quotas.
    • neoGetItemsNames: Retrieves a list of all keys in the storage, helpful for debugging or inventory of stored data.

Practical Applications: The neoLocalStorage plugin is ideal for:

    • User Preferences: Storing settings like theme choice, language selection, or custom configurations.
    • Offline Data Storage: Caching data to support offline capabilities, such as storing recent search results or session data.
    • Persistent State Management: Saving application states, such as form progress, so users can resume later.

By leveraging localForage, this plugin ensures compatibility across browsers, making it a powerful tool for any VisualNEO Web app requiring persistent client-side storage​​.

 

neoSetItem

Purpose:

Saves data to an offline store. You can store the following types of data:


Numbers, strings, arrays, JSON objects.

Category:

neoLocalStorage

Syntax:

neoSetItem "thekey" thevalue subroutine

 

thekey

Label or name assigned to the data

thevalue

Data to be saved

subroutine

Subroutine to call after saving (optional)

 

neoGetItem

Purpose:

Gets an item from the storage library and supplies the result to a callback. If the key does not exist, will return null.

Category:

neoLocalStorage

Syntax:

neoGetItem "thekey" [thevar] subroutine

 

thekey

Label or name assigned to the data

thevar

Variable to store result

subroutine

Subroutine to execute after successful loading (optional)

 

neoRemoveItem

Purpose:

Removes the value of a item from the offline store.

Category:

neoLocalStorage

Syntax:

neoRemoveItem "thekey" subroutine

 

thekey

Label or name assigned to the data

subroutine

Subroutine to execute after deleting the item (optional)

 

neoClearItems

Purpose:

Removes every item from the database, returning it to a blank slate.

Category:

neoLocalStorage

Syntax:

neoClearItems subroutine

 

subroutine

Subroutine to execute after deleting all the items (optional)

 

neoGetItemsLength

Purpose:

Gets the number of items in the offline store (i.e. its “length”).

Category:

neoLocalStorage

Syntax:

neoGetItemsLength [thevar] subroutine

 

thevar

Variable to store result

subroutine

Subroutine to execute after getting the length (optional)

 

neoGetItemsNames

Purpose:

Get the list of all items labels or names in the datastore.

Category:

neoLocalStorage

Syntax:

neoGetItemsNames [thevar] subroutine

 

thevar

Array to store the labels

subroutine

Subroutine to execute after getting the items names (optional)

Created with the Personal Edition of HelpNDoc: Maximize Your Productivity with HelpNDoc's CHM Help File Creation Features