Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc