Skip to content

Instantly share code, notes, and snippets.

View christianlacerda's full-sized avatar

Christian Lacerda christianlacerda

View GitHub Profile
@christianlacerda
christianlacerda / firestore-field-filter.ts
Last active April 28, 2023 05:18
Filters Firestore events based on field name and event type
import * as admin from 'firebase-admin';
import { Change, EventContext } from 'firebase-functions';
import { isEqual } from 'lodash';
import DocumentSnapshot = admin.firestore.DocumentSnapshot;
import FieldPath = admin.firestore.FieldPath;
const isEquivalent = (before: any, after: any) => {
return before && typeof before.isEqual === 'function'
? before.isEqual(after)
<link rel="import" href="../topeka-elements/theme.html">
<link rel="import" href="../topeka-elements/topeka-resources.html">
<link rel="import" href="../topeka-elements/topeka-app.html">
<polymer-element name="home-element">
<template>
<style>
:host {
position: absolute;