Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 1.02 KB

README.md

File metadata and controls

46 lines (30 loc) · 1.02 KB

Lazy Fire

This is a tiny Firebase wrapper that improves your web app performance by delaying importing the Firebase Web SDK modules.

Installation

The library is available as an npm package. To install Lazy Fire run:

npm install lazyfire --save
# Or using Yarn:
yarn add lazyfire

Using

First, import lazyfire in your entry point and assign Firebase app configuration, as you would do with firebase.initializeApp:

import { configureApp } from "lazyfire";

configureApp({
  // Firebase app configuration
});

This will store the Firebase app configuration for later use.

When you would need Firebase functionality:

const { app } = await ensureApp();
await import("firebase/storage");
await app.storage().ref(path).delete();

This will import firebase/app and run firebase.initializeApp with stored configuration if needed.

Changelog

See the changelog.

License

MIT © Sasha Kossd