Created
May 13, 2021 12:43
-
-
Save DougAnderson444/41ea451bfb91375f97bfaf2b14095f47 to your computer and use it in GitHub Desktop.
RPC-Using-App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import { onMount } from "svelte"; | |
export let methods; // prop passed in from main.js | |
let answer = "Loading..."; | |
onMount(async () => { | |
const ans = await methods.getAnswer(); // via RPC proxy and Deno server | |
answer = ans.result; | |
}); | |
</script> | |
<main> | |
<h1>Hello Deno RPC!</h1> | |
<p>Here is the value from Web Aseembly in Deno:</p> | |
<div class="answer">{answer}</div> | |
</main> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment