Skip to content

Instantly share code, notes, and snippets.

View dailymp's full-sized avatar
🏠
Working from home

Daily Miranda Pardo dailymp

🏠
Working from home
View GitHub Profile
@dailymp
dailymp / sass-7-1-pattern.scss
Created March 29, 2019 20:31 — forked from rveitch/sass-7-1-pattern.scss
Sass 7-1 Pattern
sass/
|
|– base/
| |– _reset.scss # Reset/normalize
| |– _typography.scss # Typography rules
| ... # Etc…
|
|– components/
| |– _buttons.scss # Buttons
| |– _carousel.scss # Carousel
@dailymp
dailymp / Pods
Created February 20, 2019 07:32
Usually we organize our javascript apps either by what they are or by what they do. The first is like rails: separate directories like components, containers, reducers, etc. And the second more or less like feature/DDD: user, cart, and so on. Tho both of these options are very mainstream and solid they contain some constraints.
When you structure the code files tree by what they are you tend to keep every component of the same feature so distant that it’s very difficult to connect the pieces. Therefore you dive into some troubles like the path hell; a lot of require('../../../etc') in your code. And everything is extremely coupled to the directory structure.
In the other hand, when you are driven by what they do everything is more isolated and maintainable. But there’s a lot of duplication. And the communication between the features either is based on a weak contract or depends upon some infrastructure. Both of these options are prone to raise some bugs.
Pods it’s an evolution of the last one. You can thin
// UNION
// Siguiendo la analogía anterior, la unión de tipos sería entendida como
// el operador OR.
// La unión de tipos es muy util para indicar que una determinada
// entidad podrá ser de un tipo u otro, ámbos válidos.
// Por ejemplo, sin unión, tendriamos que recurrir al any para admitir
// argumentos de tipo string o númerico: