Closed mizzao closed 3 years ago
Good day Andrew.
The SDK does not natively support observables, but what I do in Angular is something along these lines:
query(): Observable<Partial<Blog>[]> {
return from(
this.flamelink.flApp.content.get({
schemaKey: 'posts',
populate: [
{ field: 'author', fields: ['name', 'surname'] },
{
field: 'cardImage',
fields: ['url'],
size: { path: '375_9999_100' },
},
],
}) as Promise<Partial<Blog>[]>
).pipe(
untilDestroyed(this),
map((entries) =>
Object.keys(entries).map((key) => entries[key])
)
);
}
Hi @mizzao, does the answer from @coenraadf above help to resolve your query?
Closing this due to inactivity
Hi there, we're a paying Flamelink user. Is there any way to use this SDK with Observables / RxJS?
Your old SDK seemed to support it, but only for Realtime DB: https://github.com/flamelink/flamelink/blob/master/docs/content.md#subscribe
We're using Firestore now, and it seems like there is no Observable support anymore, at least from the docs I found. Is that true? https://flamelink.github.io/flamelink-js-sdk/#/migration-guide
Happy to be proven wrong and pointed in the right direction if there are any docs!