Cached Firebase
Cache Firebase data for offline storage.
- Uses localForage for performance (non-blocking async localStorage)
- Uses Promises
var CachedRef = require('cached-firebase');
var url = 'https://xxxx.firebaseio.com/your/url';
var ref = new CachedRef(url,{
timeout: 60000
value: null
key: '...'
})
ref.isReady
ref.isReady.then(function(cachedValue){ ... });
ref.isLoaded
ref.loaded.then(function(firebaseValue){ ... });
ref.value;
ref.set();
CachedRef.TIMEOUT = 60000;
TODO
- Documentation
- Export CommonJS to global build (webpack)
- Check if bower installation works