wq/store.js: re-evaluate and potentially overhaul
Closed this issue · 3 comments
As the first major wq.app module(77f8903#diff-16), wq/store.js is unique in that it is the only major module with no external dependencies (other than shims and jQuery.ajax
, the latter which should/could be factored out). It's time to evaluate whether there are any popular third-party localStorage
-persisted Model libraries that have arisen in the last 2 years or so that fulfill similar needs and would be worth incorporating.
Specifically, the following actions need to be taken:
- Fully document wq/store.js' existing functionality and API
- Evaluate third party alternatives, and whether any have the same or comparable functionality
- If a replacement is found, determine whether to keep wq/store.js as a compatibility wrapper, or switch to using the new library directly
- If no similar libraries can be found, document why wq/store.js is unique
- In either case, consider splitting out
ds.getList()
into a separate module (probablywq/model.js
)
Also consider an eventual migration to IndexedDB, and an async-only API. (See #17)
One potential lib: https://github.com/mozilla/localForage
localForage
looks like the best cross-platform solution for now, and won't require much in the way of immediate changes (other than #17). Eventually will want something that leverages IndexedDB
's ability to query on arbitrary columns but that can wait. Will keep wq/store.js as a compatibility wrapper (the AJAX workflow in particular is still unique).