Warren Buckley
03/01/2024, 12:56 PM<uui-loader>
whilst waiting for my API response call ?Warren Buckley
03/01/2024, 12:58 PMWarren Buckley
03/01/2024, 12:59 PMisLoaded
or something like that that gets set to true in the promise coming back from the API callWarren Buckley
03/01/2024, 1:00 PMWarren Buckley
03/01/2024, 1:07 PMWarren Buckley
03/01/2024, 1:13 PMWarren Buckley
03/01/2024, 1:23 PMprivate async _getThing(key: string) : Promise<ISearchResult | undefined> {
const { data, error } = await tryExecuteAndNotify(this, ThingResource.getThing({key: key}))
if (error){
console.error(error);
return undefined;
}
this._hasLoadedRecord = true;
return data;
}
render() {
return html`
<umb-body-layout headline="Thingy">
<uui-box>
${ this._hasLoadedRecord ? html `<h2>${this._thingItem?.id}</h2>` : html `<uui-loader></uui-loader>` }
</uui-box>
<uui-box>
<h2>Return Value</h2>
</uui-box>
<div slot="actions">
<uui-button id="close" label="Close" @click="${this.handleClose}">Close</uui-button>
</div>
</umb-body-layout>
`;
}
Warren Buckley
03/01/2024, 1:27 PM@property()
to make it reactive 🙈Niels Lyngsø
03/03/2024, 1:53 PMWarren Buckley
03/03/2024, 6:07 PMWarren Buckley
03/03/2024, 6:07 PMNiels Lyngsø
03/03/2024, 6:08 PMNiels Lyngsø
03/03/2024, 6:09 PMWarren Buckley
03/03/2024, 7:42 PM