MethodsStatic Display Method | Fire Snippets Docs
Static Display Method
Displays static data from Firestore with optional real-time updates.
staticDisplay(snippetId, variables, onUpdate)
Description
Displays data from Firestore in specified HTML elements, updating the content in real-time if enabled. It can handle both document and collection references, apply query conditions, and sort orders.
Method Signature
Parameters
- snippetId: (string) The ID of the static display snippet configuration.
- variables: (Array) An array of objects containing variable names and values to replace placeholders in the Firestore path or query conditions.
- onUpdate: (function) A callback function that is called whenever data is fetched or updated. Receives the data as a parameter.
Returns
- Promise: Resolves with an object containing an
unsubscribe
method to stop real-time updates, or rejects with an error.
Usage Example
HTML Elements Required
Ensure your HTML includes the elements with IDs specified in your fieldMappings
:
Was this helpful?