You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

cached-firebase

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cached-firebase

Cache Firebase for offline use

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

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 // timeout before promise rejects
	value: null // initial value
	key: '...' // key in localStorage
})

ref.isReady // loaded from localForage?
ref.isReady.then(function(cachedValue){ ... });

ref.isLoaded // loaded from Firebase?
ref.loaded.then(function(firebaseValue){ ... });

ref.value; // current value
ref.set(); // saves current value

CachedRef.TIMEOUT = 60000; // default timeout

TODO

  • Documentation
  • Export CommonJS to global build (webpack)
  • Check if bower installation works

Keywords

firebase

FAQs

Package last updated on 28 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts