I have searched high and low for a way to make this work. I will describe what I am trying to do first. Maybe I'm just missing something easy.
- I have a local page variable called combinedString.
- I have a firebase collection. Each document holds a field "message" that this a portition or block of a larger text string.
I need to query for the latest 20 documents and register for updates. My custom action should loop through all queried documents, starting with the oldest document first. It should append the message to the combinedString variable. As documents are processed or after the loop is completed, the cobminedString should update in the UI.
I would like this action to be called on page load and every new document that is added to the collection if possible. I thought I almost had it working using the OnChange action.... but I was not able to process the values returned by the original query on page load.
Access firebase background query documents in custom action
1