Skip to content

Commit

Permalink
feat: use object destructuring in the function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Jun 28, 2024
1 parent b08edea commit d943231
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion export_template/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
></script>
<script type="module">
import { runExportedApp } from "./{{REL_PATH}}shinylive/shinylive.js";
runExportedApp("root", "{{APP_ENGINE}}", "{{REL_PATH}}");
runExportedApp({
id: "root",
appEngine: "{{APP_ENGINE}}",
relPath: "{{REL_PATH}}",
});
</script>
<link rel="stylesheet" href="./{{REL_PATH}}shinylive/style-resets.css" />
<link rel="stylesheet" href="./{{REL_PATH}}shinylive/shinylive.css" />
Expand Down
12 changes: 8 additions & 4 deletions src/Components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,15 @@ export function App({

// This function helps launch apps exported with the shinylive Python and R
// packages and is used by `export_template/index.html`.
export async function runExportedApp(
id: string,
appEngine: AppEngine,
export async function runExportedApp({
id,
appEngine,
relPath = "",
) {
}: {
id: string;
appEngine: AppEngine;
relPath: string;
}) {
const response = await fetch("./app.json");
if (!response.ok) {
throw new Error("HTTP error loading app.json: " + response.status);
Expand Down

0 comments on commit d943231

Please sign in to comment.