3 ms·
This looks very nice Why use React style capitalized names for components, like App instead of app? It's a bummer when framework breaks a languages style conve
by seniorsassycat 3y ago
This looks very nice
Why use React style capitalized names for components, like App instead of app? It's a bummer when framework breaks a languages style conventions.
I'm confused by 'derived signals'. How is a derived signal different than a signal?
> Using a derived signal like this means that the calculation runs once per signal change per place we access double_count
https://leptos-rs.github.io/leptos/view/02_dynamic_attributes.html#derived-signals https://leptos-rs.github.io/leptos/view/02_dynamic_attribute...
- spoiler 3y agoI think that the idea (before they add the memoization that the docs mention) is that this only serves as a way to name a computation, so you don't have to litter the same logic in multiple places but can instead just call the lambda instead Edit to add: > Why use React style capitalized names for components, like App instead of app? It's a bummer when framework breaks a languages style conventions. I understand the remark, but on the other hand I also don't mind it; even like what they've done. I think it's useful as a signal that this this is component code, and has the added benefit that it looks familiar to other frontend code
- seniorsassycat 3y ago> only serves as a way to name a computation that is what a rust closure assigned to a variable does right. Why does a derived signal need a new name?
- qwertycrackers 3y agoA derived signal is generally a closure. The word just reminds you that the signals have scope-based tracking so the framework knows when they have become invalid and need to run again
- khuedoan 3y agoFrom this section https://leptos-rs.github.io/leptos/view/03_components.html#component-props https://leptos-rs.github.io/leptos/view/03_components.html#c... > Using a component in the view looks a lot like using an HTML element. You’ll notice that you can easily tell the difference between an element and a component because components always have PascalCase names.