Synphonyte / leptos-use

Collection of essential Leptos utilities inspired by React-Use / VueUse
https://leptos-use.rs/
Apache License 2.0
328 stars 72 forks source link

chore(docs): provide docs on how to handle unused `FnOnce` #134

Closed EstebanBorai closed 2 months ago

EstebanBorai commented 3 months ago

Updates https://leptos-use.rs/sensors/on_click_outside.html documentation to explain the origin of:

unused implementer of `FnOnce` that must be used
closures are lazy and do nothing unless called

And also provide a workaround.

EstebanBorai commented 3 months ago

Thank you so much for improving the docs!

Hi @maccesch! Thanks for the quick reply, based on the comments Im a bit unsure on how to move forward with this PR.

As I understand the goal is not to encourage users to use let _?

maccesch commented 3 months ago

Exactly. No need to include it in the docs because this is standard Rust practice anyway

maccesch commented 3 months ago

Oh I just realized I mistyped. I wanted to say that we could include the note about the returned stop function though. Sorry!

EstebanBorai commented 3 months ago

Oh I just realized I mistyped. I wanted to say that we could include the note about the returned stop function though. Sorry!

Oh! No worries!

EstebanBorai commented 3 months ago

Hi @maccesch!

Im a bit unsure on what are the suggestions on the doc comments, Im happy to apply them! Can you please elaborate a bit on your POV so we land this PR together?

maccesch commented 3 months ago

I saw that you pushed a commit but here it still shows all three changes