9 Matching Annotations
- Nov 2021
-
stackoverflow.com stackoverflow.com
-
-
The consumer component will barely change from our last example. The only difference is the way we'll get a reference to our store (since now the store is exported from the JS module):
-
Now your whole WS logic can be encapsulated in your JS module. That makes for good separation of concern.
-
Stores are the idiomatic Svelte way when you need to import "reactivity" from your normal JS sources.
-
- Jun 2021
-
stackoverflow.com stackoverflow.com
-
One of the consequences (although arguably not the primary motivation) of DRY is that you tend to end up with chunks of complex code expressed once, with simpler code referencing it throughout the codebase. I can't speak for anyone else, but I consider it a win if I can reduce repetition and tuck it away in some framework or initialisation code. Having a single accessor definition for a commonly used accessor makes me happy - and the new Object class code can be tested to hell and back. The upshot is more beautiful, readable code.
new tag?:
- extract reusable functions to reduce duplication / allow elegant patterns elsewhere
-
- Oct 2020
-
-
Yes, you can embed loops in it and compose lots of small repeated JSX snippets, but that almost never happens in practice because mixing the turing complete of javascript with the markup of HTML eliminates the readability of JSX so that it is actually harder to parse than a solution like hyperscript (the syntactical approach taken by virtual-dom).
-
- Sep 2020
-
tailwindcss.com tailwindcss.com
-
This is easily solved by extracting components, either as template partials/JavaScript components, or using Tailwind's @apply feature to create abstractions around common utility patterns.
-
- Dec 2018