Archived
feat: bundle workspace tasks plugin
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
interface Updatable {
|
||||
requestUpdate: () => void;
|
||||
}
|
||||
|
||||
export function requestPiWebRender(): void {
|
||||
const app = document.querySelector("pi-web-app");
|
||||
if (isUpdatable(app)) app.requestUpdate();
|
||||
}
|
||||
|
||||
function isUpdatable(value: unknown): value is Updatable {
|
||||
return isRecord(value) && typeof value["requestUpdate"] === "function";
|
||||
}
|
||||
|
||||
function isRecord(value: unknown): value is Record<string, unknown> {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
Reference in New Issue
Block a user