Snapshot vs valuechanges vs statechanges Flashcards
(3 cards)
What is the difference between value changes and snapshot changes and state changes?
all 3 are listening to live changes on db but value changes will get only the documents while the snapshot changes will get the snapshot of all documents including the id of document and other document properties. State changes is the same as snapshot changes but will get only the document that changed last after the first subscription.
When you use all 3?
valuechanges used to display data, and snapshotchanges used to update data or insert new data in db.
state changes used to get the last modified param
How can you change the value only once using the methods above ? not listenig to db changes
using first() method from rsjx which is will close all connections to the subscription after first one is done.