AppGyver/supersonic — pull request #51 by Ezku (2014-12-19 15:43:32+00:00)
Title: Feature/data caching

Adds caching as a configurable, experimental opt-in feature for `supersonic.data.model`.

Usage:

# Enable cache and set timeToLive
supersonic.data.model('task', {
cache:
enabled: true
timeToLive: 10000
})

# When using 3-way data binding, adjust polling interval accordingly (eg. from 10000 to 1000) to increase liveness
supersonic.data.model('task').all({}, { interval: 1000 }).whenChanged ->
# Local writes to the model will invalidate the cache and allow the view to reflect changes faster than when using polling

Uses `localforage` for storing cached data. Defaults to WebSQL for the actual storage method.