npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

firestore-extended

v0.0.23

Published

Simplify the work with complex and deep objects while retaining all the great benefits from Firebase Firestore.

Downloads

44

Readme

Firestore Extended (web and node.js)

Simplify the work with complex and deep objects while retaining all the great benefits from Firebase Firestore.

npm install firebase rxjs firestore-extended --save

Firestore splits its data up into collections and documents which is what allows it to be scalable and fast.

The issues that this can cause is that the best way to store your data might not be the best way to work with and display that data.

It can also be more difficult to figure out how to store your data in a way that is not only cheap in terms of reads but also cheap in terms of performance/speed.

Firestore Extended is meant to help developers solve these issues.

Documentation and Examples

Documentation Github npm Demo

Documentation

Introduction

Actions

Read Write Update Delete Edit Id

Demo

You can find a simple demo in projects/demo.

It can be run locally if you provide your own firebaseConfig in the environment file or you can find a running demo here: Demo

Steps to run locally:

npm install
npm run start

Using the library

This will add and read the Address in a collection inside each Restaurant Document.

example.fs.service.ts

export interface Address {
  zipCode: string;
  city: string;
  line1: string;
}

export interface Restaurant {
  address: Address
}

const restaurantSubCollectionWriters: SubCollectionWriter[] = [
  // add address sub Collection inside each Example Document
  {name: 'address'},
];

const restaurantSubCollectionQueries: SubCollectionQuery[] = [
  // listen for address sub Collection inside each Example Document
  {name: 'address'},
];

export class RestaurantFsService { // <-- Service for listening/writing to Firestore

  app: FirebaseApp;
  firestoreExt: FirestoreExt;  //
  restaurantCollectionRef: CollectionReference<Restaurant>;
  firestore: Firestore;

  constructor() {
    this.app = initializeApp(environment.firebase); // only call this once per application
    this.firestore = getFirestore(this.app);
    this.firestoreExt = new FirestoreExt(this.app);  //  initialize FirestoreExt with firebase app
    this.collectionRef = collection<Restaurant>(this.firestore, 'restaurants');
  }

  listenForRestaurants$(): Observable<FireItem<Restaurant>[]> {
    return this.firestoreExt.listenForCollection$<Restaurant>(this.collectionRef);
  }
}

Angular

Please read Angular README for more information regarding use with Angular.

See the Documentation for much more information.

License

MIT © Daniel Lofgren