// https://stackblitz.com/edit/typescript-h68plq?file=index.ts import firebase from 'firebase/app'; import 'firebase/firestore'; import { syncWithElements } from './sync'; const app = firebase.initializeApp({ projectId: "alwaysbecaching" }); const unsub = syncWithElements(app, { parent: document.querySelector('.container'), collectionName: 'boxes', classList: ['box'], config: { id: 'id', text: 'innerText', bg: 'style.backgroundColor', color: 'style.color' }, events: ['added', 'modified'] });