firebase / firebase/firebase-android-sdk
Get a trigger of addSnapshotListener() or listen to changes in specific properties
- Lingua principale
- Java
- Stelle
- 2.6k
- Fork
- 710
- Merge medio
- 3g 1h
- PR unite (30g)
- 34
Descrizione
## What feature would you like to see?
I would like to 1) receive snapshots only if certain properties are updated (i.e. do not receive snapshots if some other properties are updated) or 2) find a source which triggered the snapshot listener, so that I can check properties.
It can be done by comparing the existing object with a newly received, but I would like to avoid it as it will result in spaghetti code.
## How would you use it?
1) For properties to exclude
FireStoreCollectionOrDocument
.addSnapshotListener(
new String[] {"prop1", "prop2"},
(doc, ex) -> { ... });
2) For checking the listener trigger
FireStoreCollectionOrDocument
.addSnapshotListener((doc, ex, metaData) -> {
String a = metaData.getTriggerProperty();
// or String[] b = metaData.getTriggerProperties();
...
})
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia esaminando l’API addSnapshotListener() esistente e il comportamento del listener di Firestore descritto nell’issue. Confronta i due approcci proposti — filtrare in base alle proprietà o esporre le proprietà del trigger — e definisci quale comportamento, quale forma dell’API e quali criteri di completamento il progetto accetterebbe.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- firebase, java
- Ambito
- api, database
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100