-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add wasm example #16
base: master
Are you sure you want to change the base?
add wasm example #16
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for sharing this unexpected, yet valid usecase for this crate! There are some minor changes that I request and I would love to merge this
align-items: center; | ||
width: 200px; | ||
height: 100px; | ||
background-color: lightgray; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not override the default style to have a standard "animation" visible
<div class="clickable-area"> | ||
<span>Press Area</span> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's change this to
<div class="clickable-area"> | |
<span>Press Area</span> | |
</div> | |
<button class="clickable-area" type="button">Button</button> |
} | ||
|
||
#[derive(Clone, Default)] | ||
struct MockButtonPin(Rc<RefCell<bool>>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel like it is a mock, let's change the name to ButtonInput
or something
|
||
impl WasmInstant { | ||
fn now() -> WasmInstant { | ||
WasmInstant(Date::now() as u64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this! I think you can even implement impl InstantProvider<Duration> for Date
in the crate istef and guard it by a feature "wasm" as it already implements Sub
@@ -0,0 +1,117 @@ | |||
use std::{cell::RefCell, ops::Sub, rc::Rc, time::Duration}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a top-level comment similar to other examples? For example how to run this (trunk serve
?)
No description provided.