Managed Objects
provideObjects()
Registers a provider for a managed object type.
Objects can be queried by running queryObjects()
.
ts
// app.ts
import { provideObjects } from '@telia-ace/alliance-framework';
export default function () {
provideObjects('theObject', async (args) => {
const objects = await fetchObjectsFromMyService(args);
return objects;
});
}
queryObjects()
Runs a query for a type of managed object.
Managed objects are provided by apps using provideObjects()
.
ts
// app.ts
import { queryObjects } from '@telia-ace/alliance-framework';
export default function () {
const query = queryObjects('theObject', {
// args
});
query.resolve().then((objects) => {
console.log(objects);
});
query.watch(async () => {
const updatedResult = await query.resolve();
});
}