app-storage
app-storage copied to clipboard
Can app-indexeddb-mirror receive liveData from several sources?
Description
A question about the relationship between the app-indexeddb-mirror element and its source element(s).
This is from the app-indexeddb-mirror doc page:
<firebase-query
app-name="cats-app"
path="/cats"
order-by-child="name"
data="{{liveData}}">
</firebase-query>
<app-indexeddb-mirror
key="cats"
data="{{liveData}}"
persisted-data="{{persistedData}}">
</app-indexeddb-mirror>
But what if I want several sources (of identically structured items) to end up in a single app-indexeddb-mirror. I.e. something like:
<template is="dom-repeat" items="[[names]]">
<firebase-query
app-name="cats-app"
path="/cats"
order-by-child="name"
equal-to="[[item.name]]"
data="{{liveData}}">
</template>
<app-indexeddb-mirror
key="cats"
data="{{liveData}}"
persisted-data="{{persistedData}}">
</app-indexeddb-mirror>
I tried this and it does work, but only sometimes. It seems to break when names changes. So two questions: 1 Is this a valid use case for use of app-indexeddb-mirror? 2 If not, any recommendation of how something like this should be implemented?