exploration(hyperdrive): problem statement (#219)

This commit is contained in:
Ayo Ayco 2022-11-29 21:00:43 +01:00 committed by GitHub
parent bcbb517828
commit a4ea634b5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,5 @@
--- ---
import Layout from "../../components/Layout.astro"; import Layout from "../../components/Layout.astro";
const Counter = { const Counter = {
count: 0, count: 0,
increment() { increment() {
@ -13,5 +12,12 @@ const Counter = {
--- ---
<Layout title="Hyperdrive Experiment"> <Layout title="Hyperdrive Experiment">
<!-- PROBLEM STATEMENT
This is the problem that `hyperdrive` is trying to solve.
After this is rendered in the server, the Counter object is not serialized.
When the HTML reaches the browser, it has no idea what Counter is.
-->
<button onclick="Counter.increment()">
{Counter.count} {Counter.count}
</button>
</Layout> </Layout>