-
-
Notifications
You must be signed in to change notification settings - Fork 79
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 more methods to UseDocument
and UseWindow
#39
Comments
Assign this to me please |
Done. Thanks for taking this on! |
Hi, I checked out the repo, correct me if I misunderstood. |
Yes But the idea is to implement methods that are available on As you can see there's actually a macro to help with this. It is just a matter of going through the methods on |
@mamaicode Any updates on this? |
Hey, thinking about tackling this! I just want to clarify my understanding from reading your request. So for this, I'd go into use_document.rs and create a ton of impl's something like: impl_ssr_safe_method!(
set_body(&self, value: Option<&web_sys::HtmlElement>) ;
); referencing all implementations from the page: https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Document.html# Does this look about right? |
That's great, thanks! Yes exactly. You don't have to implement every last one. I can imagine there might be some that don't make sense, but you can be the judge of that. And then it makes sense to see what to do about the return type. If it already returns an Similar in the case of a Let me know if there are any more questions. |
Thanks for the additional input, I'm taking this on specifically to master the type conversions in Rust/Leptos. Honestly...I may do this in a few steps, since there are so many. I can think of several to start with for personal convenience, but do you have any tips on importance for this project specifically? @maccesch |
I've started looking at the 4 completed examples for inspiration to start and I noticed 3 of them look basically the same, however In this instance you added an Thanks. |
Ok, sorry if I'm blowing you up! 1 more question so far, I've run into a few that have no return type, such as |
Hey thanks for taking a good look at this! There's no priorities at all and you can totally feel free to do it in however many steps are convenient for you. Re Re I hope this helps! |
There are several methods which forward the calls, like
UseDocument::body
. Depending on the method if it already returns anOption<...>
type it makes sense to add the postfix.unwrap_or_default()
to return always none on the server.The text was updated successfully, but these errors were encountered: