https://github.com/kossnocorp/lazyfire
⚡ Speed up your Firebase web app
https://github.com/kossnocorp/lazyfire
Last synced: 15 days ago
JSON representation
⚡ Speed up your Firebase web app
- Host: GitHub
- URL: https://github.com/kossnocorp/lazyfire
- Owner: kossnocorp
- Created: 2021-06-07T11:08:13.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-09T03:00:20.000Z (almost 4 years ago)
- Last Synced: 2024-10-05T13:53:52.576Z (7 months ago)
- Language: TypeScript
- Size: 8.79 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# 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](https://www.npmjs.com/package/lazyfire).
To install Lazy Fire run:```sh
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`:
```js
import { configureApp } from "lazyfire";configureApp({
// Firebase app configuration
});
```This will store the Firebase app configuration for later use.
When you would need Firebase functionality:
```js
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](./CHANGELOG.md).
## License
[MIT © Sasha Koss](https://kossnocorp.mit-license.org/)d