Data Module
Please note that these functions utilize localStorage and do not yet have fallbacks. A lack of localStorage (such as Safari's private browsing) will prevent usage. Earlier versions had various fallbacks and advanced options (such as LevelDB), which is why we introduced callback methods. However, the current version only supports LocalStorage. This will be fixed by version 1.0.
Data Functions & Variables
The Data Module features the following functions:
$.fn.blockstrap.data.find
(collection, key, callback)$.fn.blockstrap.data.item
(collection, key)$.fn.blockstrap.data.option
(key)$.fn.blockstrap.data.save
(collection, key, value, callback)
data.find
(collection, key, callback) - back to top
This function uses the collection
and key
to retreave the corresponding value from localStorage.
It then performs the provided callback
function and carries over the results.
data.item
(collection, key) - back to top
This function is used internally to map the collection
and key
and returns a new key.
Given user
and name
it would return nw_user_name
.
data.option
(key) - back to top
This function takes the key
and returns the value from within the nw_blockstrap_options
entry.
data.save
(collection, key, value, callback) - back to top
This function uses the collection
and key
to store the corresponding value
into localStorage.
It then performs the provided callback
function and carries over the results.
- Related Articles
- Back to Modules
- Accounts
- API
- Buttons
- Contacts
- Blockchains
- Data
- Filters
- Forms
- Security
- Styles
- Templates
- Table of Contents