From e7edfc1e8cee8c8bb8d784d19b8524e40c87a816 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 8 Sep 2018 23:46:40 -0400 Subject: [PATCH] Get everything (I can) running --- README.md | 5 +++++ percy/static/app_loader.js | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 README.md create mode 100644 percy/static/app_loader.js diff --git a/README.md b/README.md new file mode 100644 index 0000000..20262c0 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Electron applications in Rust + +Each app is a starter example, and can be run with `yarn install && yarn start`. + +`stdweb` and `yew` examples currently don't run. \ No newline at end of file diff --git a/percy/static/app_loader.js b/percy/static/app_loader.js new file mode 100644 index 0000000..2b50a7e --- /dev/null +++ b/percy/static/app_loader.js @@ -0,0 +1,10 @@ +const app = import("./percy") +app.then(module => { + console.log("Finished resolving application bundle") + let rootNode = document.getElementById('root') + rootNode.parentElement.replaceChild(module.main(), rootNode) + rootNode = document.getElementById('root') +}, (e) => { + console.log("Unable to resolve application bundle: ") + console.log(e) +}) \ No newline at end of file